facebookresearch / NSVF

Open source code for the paper of Neural Sparse Voxel Fields.
MIT License
805 stars 92 forks source link

RuntimeError: shape '[256, -1, 60]' is invalid for input of size 15240 #39

Open ghasemikasra39 opened 3 years ago

ghasemikasra39 commented 3 years ago

Running script:

python -u /home/stud/kghasemi/.pycharm_helpers/pydev/pydevd.py --multiproc --qt-support=auto --client 0.0.0.0 --port 41219 --file /tmp/kghasemi/GRF/train.py /tmp/kghasemi/data/Synthetic_NSVF/Wineholder --user-dir fairnr --task single_object_rendering --train-views 0..100 --view-resolution 200x200 --max-sentences 1 --view-per-batch 2 --pixel-per-view 64 --no-preload --sampling-on-mask 1.0 --no-sampling-at-reader --disable-validation --valid-view-resolution 200x200 --valid-views 100..200 --valid-view-per-batch 2 --transparent-background 1.0,1.0,1.0 --background-stop-gradient --arch nsvf_base --initial-boundingbox /tmp/kghasemi/data/Synthetic_NSVF/Wineholder/bbox.txt --raymarching-stepsize-ratio 0.125 --use-octree --discrete-regularization --color-weight 128.0 --alpha-weight 1.0 --optimizer adam --adam-betas "(0.9, 0.999)" --lr-scheduler polynomial_decay --total-num-update 150000 --lr 0.001 --clip-norm 0.0 --criterion srn_loss --num-workers 0 --seed 2 --save-interval-updates 500 --max-update 150000 --virtual-epoch-steps 50 --save-interval 1 --half-voxel-size-at 5000,25000,75000 --reduce-step-size-at 5000,25000,75000 --pruning-every-steps 2500 --keep-interval-updates 5 --log-format simple --log-interval 1 --tensorboard-logdir checkpoint/Wineholder/tensorboard/nsvf_basev2 --save-dir checkpoint/Wineholder/nsvf_basev2

When I choose --pixel-per-view 64 after a few epochs training on Wineholder, I get this error:

Traceback (most recent call last):
data_utils.py: get_uv  File "/tmp/kghasemi/conda/lib/python3.8/contextlib.py", line 131, in __exit__

    self.gen.throw(type, value, traceback)
  File "/tmp/kghasemi/conda/lib/python3.8/site-packages/fairseq/logging/metrics.py", line 95, in aggregate
    yield agg
  File "/tmp/kghasemi/conda/lib/python3.8/contextlib.py", line 75, in inner
    return func(*args, **kwds)
  File "/tmp/kghasemi/GRF/fairnr_cli/train.py", line 184, in train
    log_output = trainer.train_step(samples)
  File "/tmp/kghasemi/conda/lib/python3.8/contextlib.py", line 75, in inner
    return func(*args, **kwds)
  File "/tmp/kghasemi/conda/lib/python3.8/site-packages/fairseq/trainer.py", line 457, in train_step
    raise e
  File "/tmp/kghasemi/conda/lib/python3.8/site-packages/fairseq/trainer.py", line 425, in train_step
    loss, sample_size_i, logging_output = self.task.train_step(
  File "/tmp/kghasemi/GRF/fairnr/tasks/neural_rendering.py", line 300, in train_step
    return super().train_step(sample, model, criterion, optimizer, update_num, ignore_grad)
  File "/tmp/kghasemi/conda/lib/python3.8/site-packages/fairseq/tasks/fairseq_task.py", line 351, in train_step
    loss, sample_size, logging_output = criterion(model, sample)
  File "/tmp/kghasemi/conda/lib/python3.8/site-packages/torch/nn/modules/module.py", line 532, in __call__
    result = self.forward(*input, **kwargs)
  File "/tmp/kghasemi/GRF/fairnr/criterions/rendering_loss.py", line 42, in forward
    net_output = model(**sample)
  File "/tmp/kghasemi/conda/lib/python3.8/site-packages/torch/nn/modules/module.py", line 532, in __call__
    result = self.forward(*input, **kwargs)
  File "/tmp/kghasemi/GRF/fairnr/models/fairnr_model.py", line 77, in forward
    results = self._forward(ray_start, ray_dir, **kwargs)
  File "/tmp/kghasemi/GRF/fairnr/models/nsvf.py", line 79, in _forward
    samples = self.encoder.ray_sample(intersection_outputs)
  File "/tmp/kghasemi/GRF/fairnr/modules/encoder.py", line 355, in ray_sample
    sampled_idx, sampled_depth, sampled_dists = uniform_ray_sampling(
  File "/tmp/kghasemi/GRF/fairnr/clib/__init__.py", line 192, in forward
    pts_idx = pts_idx.reshape(G, -1, P)
RuntimeError: shape '[256, -1, 60]' is invalid for input of size 15240

Process finished with exit code 1
MultiPath commented 3 years ago

Hi sorry for replying quite late. I think there was a bug. Do you still have this issue?