-
Notifications
You must be signed in to change notification settings - Fork 145
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
TypeError: slice indices must be integers or None or have an __index__ method #9
Comments
Do you change any argments in "forward.py"? It runs well on my computer. |
I didnot make any code change. Clone new caffe code with windows version and make install. And run forward.py just it |
may be the python version differences. You can change the code like this: |
I did this. Pytorch version has issue. Anaconda: 3-4.1.1 Traceback (most recent call last): |
For pytorch issue(on Python 3.5.2) Add: from functools import partial And make change: |
I encountered this error as well. At some point in the index there is a "divide by 2" and Python would possibly treat it as float number after dividing by 2. Using integer casting int() should solve the problem. Mine works well in the caffe version. Not fully sure about Pytorch version. |
Traceback (most recent call last):
File "forward.py", line 134, in
main()
File "forward.py", line 98, in main
means = get_mean_npy(mean_file, crop_size = batch_shape[2:], isColor = is_color)
File "forward.py", line 20, in get_mean_npy
(_shape[3] - crop_size[1]) / 2:(_shape[3] + crop_size[1]) / 2]
TypeError: slice indices must be integers or None or have an index method
The text was updated successfully, but these errors were encountered: