allenai/Holodeck

get_top_down_frame error

Closed this issue · 5 comments

I have encountered the following issue, could you please provide some hints for debugging please.

Selecting 2 small knit blanket for armchair-0 (living room)
Selecting 2 small knit blanket for armchair-1 (living room)
Selecting 1 table clock for console table-0 (living room)
Selecting 3 framed picture for wall-mounted floating shelves-1 (living room)
Selecting 1 catch-all tray for console table-0 (living room)
Selecting 2 hourglass for wall-mounted floating shelves-1 (living room)
Only one room in the scene. Assigning the room to Procedural0.
Traceback (most recent call last):
  File "/scratch/WIP/Holodeck/main.py", line 95, in <module>
    generate_single_scene(args)
  File "/scratch/WIP/Holodeck/main.py", line 21, in generate_single_scene
    args.model.generate_scene(
  File "/scratch/WIP/Holodeck/modules/holodeck.py", line 233, in generate_scene
    top_image = get_top_down_frame(scene, self.objaverse_asset_dir, 1024, 1024)
  File "/scratch/WIP/Holodeck/modules/utils.py", line 80, in get_top_down_frame
    if all_edges_white(top_down_frame): break
  File "/scratch/WIP/Holodeck/modules/utils.py", line 18, in all_edges_white
    if not np.all(np.all(img[0, :] == white, axis=-1)):
ValueError: operands could not be broadcast together with shapes (1024,4) (3,)

Best,
Zhening

Hi,

Could you add an interrupt here to check the dimension of the image? It seems the one you pass into the function has 4 channels, not sure why this happened, but you could add one line of code to convert it to RGB.

Thanks for the quick reply. I found out that the fourth channel is 255 (not sure why it occurred), but I dropped it for generating the image. However, I have the following issue which indicates that it did not pass the test:

Only one room in the scene. Assigning the room to Procedural0.
Error: no "view" rule for type "image/png" passed its test case
       (for more information, add "--debug=1" on the command line)

Any idea what caused this problem?

Also, is there any tip for regenerating the same scene with less consumption of OpenAI tokens (to save budget)?

Best, Zhening

Could you first try to comment this line to see if you still have the error?

if all_edges_white(top_down_frame): break

Then, you could add a line of code (e.g., matplotlib) to visualize the img here:

# Define a white pixel

If you can see the image, then use PIL to convert it to RGB.

I managed to generate the image now. Thanks.

BTW, this is really great work. Congrats!

Hi,
I also got the same error.
I wanted to know why are we closing the issues before merging the fixes to the main branch?