chenguolin / InstructScene

[ICLR 2024 spotlight] Official implementation of "InstructScene: Instruction-Driven 3D Indoor Scene Synthesis with Semantic Graph Prior".
https://chenguolin.github.io/projects/InstructScene
MIT License
81 stars 11 forks source link

‘NoneType’ issue #4

Closed foojayyy closed 6 months ago

foojayyy commented 6 months ago

When running the project, the model training went smoothly, but when I executed the Inference, the following problem occurred:

: bash scripts/inference_sg2sc_objfeat.sh bedroom bedroom_sg2scdiffusion_objfeat 0 -1 threedfront_objfeat_vqvae 1.0 You have chosen to seed([0]) the experiment Run code on device [cuda:0]

Load [2398] 3D-FUTURE models Applying threed_front_bedroom filtering Add [scene graphs] to the dataset Scale ['translations', 'sizes', 'angles', 'openshape_vitg14_features'] Use [cos, sin] for angle encoding Use [Sg2Sc diffusion] model Training set has bounds: {'translations': (array([-2.7625005, 0.045 , -2.75275 ]), array([2.77844175, 3.6248396 , 2.81854277])), 'sizes': (array([0.03998288, 0.02000002, 0.012772 ]), array([2.8682 , 1.770065, 1.698315])), 'angles': (array(-3.14159265), array(3.14159265)), 'openshape_vitg14_features': (array(-0.17671695), array(0.15840416))} Load [3879] training scenes with [21] object types

Applying threed_front_bedroom filtering Add [scene graphs] to the dataset Scale ['translations', 'sizes', 'angles', 'openshape_vitg14_features'] Use [cos, sin] for angle encoding Use [Sg2Sc diffusion] model Load [162] validation scenes with [21] object types

Load pretrained VQ-VAE

Load checkpoint from out/bedroom_sg2scdiffusion_objfeat/checkpoints/epoch_00009.pth

Copy EMA parameters to the model

Sample boxes from scene graphs with the [diffusion model] Generating scenes: 100%|██████████████████████████████████████████████████████████████████| 100/100 [00:00<00:00, 169.05it/s] Postprocess [translations] by bounds [-2.7625005 0.045 -2.75275 ]~[2.77844175 3.6248396 2.81854277] Postprocess [sizes] by bounds [0.03998288 0.02000002 0.012772 ]~[2.8682 1.770065 1.698315] Postprocess [angles] by [arctan2] Process each batch: 0%| | 0/33 [00:00<?, ?it/s] AttributeError: 'NoneType' object has no attribute 'conjugate' Visualize each scene: 0%| | 0/5 [00:00<?, ?it/s] The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "src/generate_sg2sc.py", line 435, in main() File "src/generate_sg2sc.py", line 308, in main trimesh_meshes, bbox_meshes, obj_classes, objsizes, = get_textured_objects( File "/home/szu/fujianye/InstructScene/src/utils/visualize.py", line 72, in get_textured_objects furniture, select_gap = objects_dataset.get_closest_furniture_to_objfeat_and_size(query_label, query_size, query_feature, objfeat_type) File "/home/szu/fujianye/InstructScene/src/data/threed_future_dataset.py", line 71, in get_closest_furniture_to_objfeat_and_size assert np.allclose(np.linalg.norm(eval(f"oi.{objfeat_type}_features"), axis=-1), 1.0) # sanity check: already L2 normalized File "<__array_function__ internals>", line 200, in norm File "/home/szu/.conda/envs/ins/lib/python3.8/site-packages/numpy/linalg/linalg.py", line 2541, in norm s = (x.conj() * x).real TypeError: loop of ufunc does not support argument 0 of type NoneType which has no callable conjugate method Visualize each scene: 0%| | 0/5 [00:00<?, ?it/s]

I have downloaded the database you provided, but I still encountered the ‘NoneType’ issue. Could you please offer some assistance? Thank you!

chenguolin commented 6 months ago

Hi @foojayyy,

Please refer to https://github.com/chenguolin/InstructScene/issues/3.

It seems that eval(f"oi.{objfeat_type}_features") returns None. Please check your paths to the openshape features.

openshape_pointbert_vitg14.npy for each object should be located at dataset/3D-FRONT/3D-FUTURE-model/<object id> as shown in https://github.com/chenguolin/InstructScene/tree/main/dataset.

foojayyy commented 6 months ago

I’ve checked the paths to the openshape features and realized that I had made an error in the file locations. I’ve since corrected the paths and the issue has been resolved.Thank you!