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

TypeError: unhashable type: 'list' #3

Open
Max-Well-Wang opened this issue Aug 13, 2021 · 5 comments
Open

TypeError: unhashable type: 'list' #3

Max-Well-Wang opened this issue Aug 13, 2021 · 5 comments

Comments

@Max-Well-Wang
Copy link

Hello, I have the following problems when I run the main.py file. Can you help me solve it?
Traceback (most recent call last):
File "C:/Users/Administrator/Desktop/ymq/Domain-Aware-Style-Transfer-main/Domain-Aware-Style-Transfer-main/main.py", line 68, in
model = Baseline(args)
File "C:\Users\Administrator\Desktop\ymq\Domain-Aware-Style-Transfer-main\Domain-Aware-Style-Transfer-main\baseline.py", line 79, in init
pretrained_vgg = torchfile.load('./baseline_checkpoints/vgg_normalised_conv4_1.t7')
File "D:\ANACONDA\envs\pytorch\lib\site-packages\torchfile.py", line 424, in load
return reader.read_obj()
File "D:\ANACONDA\envs\pytorch\lib\site-packages\torchfile.py", line 370, in read_obj
obj._obj = self.read_obj()
File "D:\ANACONDA\envs\pytorch\lib\site-packages\torchfile.py", line 385, in read_obj
k = self.read_obj()
File "D:\ANACONDA\envs\pytorch\lib\site-packages\torchfile.py", line 386, in read_obj
v = self.read_obj()
File "D:\ANACONDA\envs\pytorch\lib\site-packages\torchfile.py", line 370, in read_obj
obj._obj = self.read_obj()
File "D:\ANACONDA\envs\pytorch\lib\site-packages\torchfile.py", line 387, in read_obj
obj[k] = v
TypeError: unhashable type: 'list'

@Kibeom-Hong
Copy link
Owner

Kibeom-Hong commented Aug 13, 2021

Thanks for your interest!

I think you should check the path of 'pretrained_vgg'.

How about set the path as the absolute path?

Please check the code at 71 lines

Thanks.

@mamemo
Copy link

mamemo commented Aug 23, 2021

Hey guys, I just had the same issue. It's a Windows specific error. When running the code on Linux it outputs the desired results.

Great work by the way!

@TerrenceHenry
Copy link

I have same error running on Win10.
File path is correct.
Any ideas on how to resolve this?

@Pragathi-PL
Copy link

Yahh same error while running in mac
any idea how to resolve ?

@surfingnirvana
Copy link

fix for windows:

baseline.py

line 71 pretrained_vgg = torchfile.load('./baseline_checkpoints/vgg_normalised_conv4_1.t7', force_8bytes_long=True)
line 445 pretrained_vgg = torchfile.load('./baseline_checkpoints/vgg_normalised_conv4_1.t7', force_8bytes_long=True)

site-packages\torchfile.py", line 288 for i in xrange(n): -------------> for i in range(n):

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

6 participants