-
Notifications
You must be signed in to change notification settings - Fork 543
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
AttributeError: 'collections.OrderedDict' object has no attribute 'iteritems' #26
Comments
Get the Python3 compatible version of skipthoughts.py here: I'm also on Anacnoda x64, and my path_to_skipthoughts looks like this: You can also just change iteritems() to items() in most of these cases to fix that error. |
Hi @ErikOmberg thanks for the Python3 compatible version.. when i try to use the new skip-thought code (py3 compatible one), i get an error message as below: C:\Users\Dell\Documents\Neural_storyteller\neural_storyteller\romance.npz Can u help me with this? I see that we are passing 2 arguments config.paths['skmodels'], config.paths['sktables'] in the original generate.py.. while in the new skipthought i see load_model does not take any arguments.. so i tried to change it to just Loading model parameters... |
You're right - I see that link I posted only had a loadmodel function with no arguments. I didn't use that code directly. I started with the master code, and made some code changes (based on that link) to get my py3 working. The necessary changes aren't too bad. It's mostly a few "items" change to "iteritems", parenthesis around print statements, etc... |
I agree.. but i am getting an error when i do so :( could u help me with the error below Loading skip-thoughts... |
Please check your bi_skip.npz file. It may be corrupt or missing if the error says it's not a valid zip file. The config.py sets the relative path like this: Skip-thoughtspaths['skmodels'] = './models/' |
Thanks a lot @ErikOmberg .. i didn't notice that my file was corrupted.. i have one question tho wrt resize in generate.py line 154: im = skimage.transform.resize(im, (256, w*256/h), preserve_range=True) |
Yes, I made that change too: |
Thanks @ErikOmberg .. I've raised a new issue #37 i was wondering if u could help me with that or have u faced similar issues while running your codes. |
Hi, I am running into a dead end with the storyteller already at one of the first steps. After having downloaded all necessary files, and set up the config.py, it still won't generate the first
import generate
gives the following error:
ERROR (theano.sandbox.cuda): Failed to compile cuda_ndarray.cu: libcublas.so.8.0: cannot open shared object file: No such file or directory
but it is still able to proceed (or at least that is how I understand it)
and then
z = generate.load_all()
runs into this error (pasting only the end)
`Loading skip-thoughts...
AttributeError Traceback (most recent call last)
in ()
----> 1 z = generate.load_all()
/home/zoza/neural-storyteller/generate.py in load_all()
84 print('Loading skip-thoughts...')
85 stv = skipthoughts.load_model(config.paths['skmodels'],
---> 86 config.paths['sktables'])
87
88 # Decoder
/home/zoza/neural-storyteller/skipthoughts.py in load_model(path_to_models, path_to_tables)
34 # Load parameters
35 uparams = init_params(uoptions)
---> 36 uparams = load_params(path_to_umodel, uparams)
37 utparams = init_tparams(uparams)
38 bparams = init_params_bi(boptions)
/home/zoza/neural-storyteller/skipthoughts.py in load_params(path, params)
173 """
174 pp = numpy.load(path)
--> 175 for kk, vv in params.iteritems():
176 if kk not in pp:
177 warnings.warn('%s is not in the archive'%kk)
AttributeError: 'collections.OrderedDict' object has no attribute 'iteritems'`
I am running Python 3.5.2 |Anaconda custom (64-bit) and I have adapted the code (print statements in brackets, cPickle module to pickle) to be able to run it on version 3.
Any help on how to fix this is appreciated!
The text was updated successfully, but these errors were encountered: