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

vgg16.t7 unhashable type: 'numpy.ndarray' #38

Closed
fuddyduddy opened this issue Jul 14, 2020 · 2 comments
Closed

vgg16.t7 unhashable type: 'numpy.ndarray' #38

fuddyduddy opened this issue Jul 14, 2020 · 2 comments

Comments

@fuddyduddy
Copy link

It's been a while since the last vgg16 issue i found on this "Issues".

So i download the vgg16.t7 from the paper quoted in this github.
And i run this command "python main.py train --epochs 4 --style-folder images/ownstyles --save-model-dir own_models --cuda 1"
i have put the vgg16.t7 into models folder, it's been detected correctly. However, the following problem happened.

Traceback (most recent call last):
  File "main.py", line 295, in <module>
    main()
  File "main.py", line 41, in main
    train(args)
  File "main.py", line 135, in train
    utils.init_vgg16(args.vgg_model_dir)
  File "C:\Users\user\Prepwork\Cap Project\PyTorch-Multi-Style-Transfer\experiments\utils.py", line 100, in init_vgg16
    vgglua = load_lua(os.path.join(model_folder, 'vgg16.t7'))
  File "C:\Users\user\anaconda3\envs\FTDS\lib\site-packages\torchfile.py", line 424, in load
    return reader.read_obj()
  File "C:\Users\user\anaconda3\envs\FTDS\lib\site-packages\torchfile.py", line 370, in read_obj
    obj._obj = self.read_obj()
  File "C:\Users\user\anaconda3\envs\FTDS\lib\site-packages\torchfile.py", line 385, in read_obj
    k = self.read_obj()
  File "C:\Users\user\anaconda3\envs\FTDS\lib\site-packages\torchfile.py", line 386, in read_obj
    v = self.read_obj()
  File "C:\Users\user\anaconda3\envs\FTDS\lib\site-packages\torchfile.py", line 370, in read_obj
    obj._obj = self.read_obj()
  File "C:\Users\user\anaconda3\envs\FTDS\lib\site-packages\torchfile.py", line 387, in read_obj
    obj[k] = v
TypeError: unhashable type: 'numpy.ndarray'

Is there anyway i can fix this? i found in other thread they said replace with another one, but i could not find another one other than from stanford.

Thanks!

@zhanghang1989
Copy link
Owner

Sorry that I am not actively maintaining this repo now.

I actually tried the code recently. The MSG-Net is still working with PyTorch 1.4.0.

@fuddyduddy
Copy link
Author

fuddyduddy commented Jul 14, 2020

Alright, thanks. I will close this issue now.

BTW, just tried downgrade to PyTorch 1.4.0. However, the following error comes up:

Traceback (most recent call last):
  File "main.py", line 295, in <module>
    main()
  File "main.py", line 36, in main
    raise ValueError("ERROR: cuda is not available, try running on CPU")
ValueError: ERROR: cuda is not available, try running on CPU

It looks like need to downgrade CUDA as well. But i am not gonna try it further due to time constraints.

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