cvlab-columbia / zero123

Zero-1-to-3: Zero-shot One Image to 3D Object (ICCV 2023)
https://zero123.cs.columbia.edu/
MIT License
2.61k stars 188 forks source link

Windows path issue #8

Closed BarfingLemurs closed 1 year ago

BarfingLemurs commented 1 year ago

This is working great on windows with novel view synthesis, but there is an small path issue with 3d reconstruction:

Loading model from ../zero123/105000.ckpt
Global Step: 165000
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.53 M params.
Keeping EMAs of 688.
making attention of type 'vanilla' with 512 in_channels
Working with z of shape (1, 4, 32, 32) = 4096 dimensions.
making attention of type 'vanilla' with 512 in_channels
Traceback (most recent call last):
  File "C:\Users\user\Desktop\zero123\3drec\run_zero123.py", line 405, in <module>
    dispatch(SJC)
  File "C:\Users\user\Desktop\zero123\3drec\my\config.py", line 76, in dispatch
    mod.run()
  File "C:\Users\user\Desktop\zero123\3drec\run_zero123.py", line 124, in run
    sjc_3d(**cfgs, poser=poser, model=model, vox=vox)
  File "C:\Users\user\Desktop\zero123\3drec\run_zero123.py", line 150, in sjc_3d
    images_, _, poses_, mask_, fov_x = load_blender('train', scene=scene, path=nerf_path)
  File "C:\Users\user\Desktop\zero123\3drec\voxnerf\data.py", line 15, in load_blender
    with open(root / f'transforms_{split}.json', "r") as f:
FileNotFoundError: [Errno 2] No such file or directory: "'data\\nerf_wild'\\'pikachu'\\transforms_train.json"
ruoshiliu commented 1 year ago

@basilevh could you please look into this? I'm not familiar with directories on Windows.

basilevh commented 1 year ago

The apostrophes (') look a bit out of place, could you retry without? Actually, I think Windows only accepts the double quotation mark " for paths (whereas Linux probably accepts both), so these two commands should both work (I think):

python run_zero123.py \
    --scene pikachu \
    --index 0 \
    --n_steps 10000 \
    --lr 0.05 \
    --sd.scale 100.0 \
    --emptiness_weight 0 \
    --depth_smooth_weight 10000. \
    --near_view_weight 10000. \
    --train_view True \
    --prefix experiments/exp_wild \
    --vox.blend_bg_texture False \
    --nerf_path data/nerf_wild

or

python run_zero123.py \
    --scene pikachu \
    --index 0 \
    --n_steps 10000 \
    --lr 0.05 \
    --sd.scale 100.0 \
    --emptiness_weight 0 \
    --depth_smooth_weight 10000. \
    --near_view_weight 10000. \
    --train_view True \
    --prefix "experiments/exp_wild" \
    --vox.blend_bg_texture False \
    --nerf_path "data/nerf_wild"

Hope this helps!

Edit: I've updated the readme to reflect this too.

BarfingLemurs commented 1 year ago
python run_zero123.py --scene pikachu --index 0 --n_steps 10000 --lr 0.05 --sd.scale 100.0 --emptiness_weight 0 --depth_smooth_weight 10000. --near_view_weight 10000. --train_view True --prefix experiments/exp_wild --vox.blend_bg_texture False --nerf_path data/nerf_wild

Thank you, I used the first option and it works.