You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/content/blobgan/./src/utils/colab.py in draw_labels(img, layout, T, colors, layout_i)
88 # draw = ImageDraw.Draw(img)
89 # mask = layout['sizes'][layout_i, 1:] > T
---> 90 # idmap = torch.arange(len(mask))[mask]
91 # blob = {k: layout[k][layout_i][mask].mul(255).tolist() for k in ('xs', 'ys')}
92 # for i, (x, y) in enumerate(zip(blob['xs'], blob['ys'])):
RuntimeError: indices should be either on cpu or on the same device as the indexed tensor (cpu)
I searched online and no solutions work for me. Could you please tell me how to solve this for manipulating blobs and generating the corresponding images?
I appreciate any help from you.
The text was updated successfully, but these errors were encountered:
Hi Dr. Epstein,
Thank you for this great work and published codes.
I tried to manipulate blobs using your BlobGAN Playground Colab (Last cell: Interactively edit scenes). I also ran the code on the server.
They both gave the same error message
RuntimeError Traceback (most recent call last)
in <cell line: 37>()
35 layout, orig_img = model.gen(z=z, truncate=truncate, layout=layout, **render_kwargs)
36 orig_blobs = for_canvas(layout['feature_img'].mul(255))
---> 37 labeled_blobs, labeled_blobs_img = draw_labels(orig_blobs, layout, size_threshold, COLORS)
38
39 blobs = DraggableBlobMap(locals())
/content/blobgan/./src/utils/colab.py in draw_labels(img, layout, T, colors, layout_i)
88 # draw = ImageDraw.Draw(img)
89 # mask = layout['sizes'][layout_i, 1:] > T
---> 90 # idmap = torch.arange(len(mask))[mask]
91 # blob = {k: layout[k][layout_i][mask].mul(255).tolist() for k in ('xs', 'ys')}
92 # for i, (x, y) in enumerate(zip(blob['xs'], blob['ys'])):
RuntimeError: indices should be either on cpu or on the same device as the indexed tensor (cpu)
I searched online and no solutions work for me. Could you please tell me how to solve this for manipulating blobs and generating the corresponding images?
I appreciate any help from you.
The text was updated successfully, but these errors were encountered: