Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test IndexError #2

Open
hanklin3 opened this issue Nov 13, 2022 · 6 comments
Open

test IndexError #2

hanklin3 opened this issue Nov 13, 2022 · 6 comments

Comments

@hanklin3
Copy link

Hi I'm getting this error.

epoch 660 running loss = 9290.15234375
epoch 670 running loss = 9752.0048828125
epoch 680 running loss = 10089.88671875
epoch 690 running loss = 8728.25
epoch 700 running loss = 8996.896484375
saving model iter 700 in /tmp/deep_shadow/models//rose_LR=5e-05_dev=mixed_700_snapshot.pth
Normed Depth Prediction Error = 0.07724940776824951
Traceback (most recent call last):
  File "train.py", line 413, in <module>
    run(args_, task_name_)
  File "train.py", line 366, in run
    test(depth_hat, writer)
  File "train.py", line 276, in test
    shadow_hat[points_to_calc[idx][0].long(), points_to_calc[idx][1].long()] = 1
IndexError: index 259 is out of bounds for dimension 0 with size 4
@asafkar
Copy link
Owner

asafkar commented Nov 13, 2022

Hi,
What exactly did you run? which flags did you use?
and - which pytorch version are you using?

@hanklin3
Copy link
Author

Training commands:
python3 train.py --object rose
Python 3.8.5
Torch '1.13.0+cu117'
kornia '0.6.8'
4 cores cpu ( not sure if that has anything to do with the 'size 4')

requirements.txt

einops
imageio
imath
kornia>0.2.0
matplotlib
numpy
opencv_python
scikit_image
scikit-image
tensorboard
torch>1.8
torchvision>0.9

Have to fix kornia>0.2.0 cause the old version missing one argument param.

I don't know if above error has to do with the speed_up_calculation, my temp fix

                        if not speed_up_calculation or (speed_up_calculation and idx < len(points_to_calc)):
                            shadow_hat[points_to_calc[idx][0].long(), points_to_calc[idx][1].long()] = 1
                        continue

I was testing with
python3 train.py --object cactus --save_dir ../models/ --speed slow
but it ran too slow so I stopped it.

@asafkar
Copy link
Owner

asafkar commented Nov 14, 2022

please refrain from using speed==slow, I left the code there only since I referred to it in the paper -
but also as stated in the paper, it does not cause any increase in accuracy.

Please let me know if using speed==fast has any issues on your end.

@hanklin3
Copy link
Author

I got the error using the default (--speed fast).
And so I was testing if --speed slow would work instead

@asafkar
Copy link
Owner

asafkar commented Nov 16, 2022

I pushed a fix.
Please try again and let me know if it's fixed on your end.

@hanklin3
Copy link
Author

thank you! I will try it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants