Comments (8)
Get the Python3 compatible version of skipthoughts.py here:
https://github.com/ryankiros/skip-thoughts/pull/53/files
I'm also on Anacnoda x64, and my path_to_skipthoughts looks like this:
path_to_skipthoughts = 'C:\neuralstoryteller\skip-thoughts-master\'
I have the models in a subfolder of that path named "models", and this works.
You can also just change iteritems() to items() in most of these cases to fix that error.
from neural-storyteller.
Please check your bi_skip.npz file. It may be corrupt or missing if the error says it's not a valid zip file.
My code makes that file name like this: path_to_bmodel = path_to_models + 'bi_skip.npz'
Mine has this size: 289,340,074 bytes
Mine is in this folder: ./models/
I have a bi_skip.npz.pkl file at the same path that is 689 bytes.
The config.py sets the relative path like this:
Skip-thoughts
paths['skmodels'] = './models/'
paths['sktables'] = './models/'
from neural-storyteller.
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
Loading skip-thoughts...
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\Dell\Documents\Neural_storyteller\neural-storyteller-master\generate.py", line 86, in load_all
config.paths['sktables'])
TypeError: load_model() takes 0 positional arguments but 2 were given
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
stv = skipthoughts.load_model()
and got the error:
Loading model parameters...
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\Dell\Documents\Neural_storyteller\neural-storyteller-master\generate.py", line 85, in load_all
stv = skipthoughts.load_model()
File "C:\Users\Dell\Documents\Neural_storyteller\neural-storyteller-master\skipthoughts.py", line 55, in load_model
bparams = load_params(path_to_bmodel, bparams)
File "C:\Users\Dell\Documents\Neural_storyteller\neural-storyteller-master\skipthoughts.py", line 259, in load_params
pp = numpy.load(path)
File "C:\Users\Dell\Anaconda3\envs\tensorflow-gpu\lib\site-packages\numpy\lib\npyio.py", line 412, in load
pickle_kwargs=pickle_kwargs)
File "C:\Users\Dell\Anaconda3\envs\tensorflow-gpu\lib\site-packages\numpy\lib\npyio.py", line 171, in init
_zip = zipfile_factory(fid)
File "C:\Users\Dell\Anaconda3\envs\tensorflow-gpu\lib\site-packages\numpy\lib\npyio.py", line 101, in zipfile_factory
return zipfile.ZipFile(file, *args, **kwargs)
File "C:\Users\Dell\Anaconda3\envs\tensorflow-gpu\lib\zipfile.py", line 1026, in init
self._RealGetContents()
File "C:\Users\Dell\Anaconda3\envs\tensorflow-gpu\lib\zipfile.py", line 1093, in _RealGetContents
raise BadZipFile("File is not a zip file")
zipfile.BadZipFile: File is not a zip file
from neural-storyteller.
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...
from neural-storyteller.
I agree.. but i am getting an error when i do so :( could u help me with the error below
Loading skip-thoughts...
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\Dell\Documents\Neural_storyteller\neural-storyteller-master\generate.py", line 86, in load_all
config.paths['sktables'])
File "C:\Users\Dell\Documents\Neural_storyteller\neural-storyteller-master\skipthoughts.py", line 39, in load_model
bparams = load_params(path_to_bmodel, bparams)
File "C:\Users\Dell\Documents\Neural_storyteller\neural-storyteller-master\skipthoughts.py", line 174, in load_params
pp = numpy.load(path)
File "C:\Users\Dell\Anaconda3\envs\tensorflow-gpu\lib\site-packages\numpy\lib\npyio.py", line 412, in load
pickle_kwargs=pickle_kwargs)
File "C:\Users\Dell\Anaconda3\envs\tensorflow-gpu\lib\site-packages\numpy\lib\npyio.py", line 171, in init
_zip = zipfile_factory(fid)
File "C:\Users\Dell\Anaconda3\envs\tensorflow-gpu\lib\site-packages\numpy\lib\npyio.py", line 101, in zipfile_factory
return zipfile.ZipFile(file, *args, **kwargs)
File "C:\Users\Dell\Anaconda3\envs\tensorflow-gpu\lib\zipfile.py", line 1026, in init
self._RealGetContents()
File "C:\Users\Dell\Anaconda3\envs\tensorflow-gpu\lib\zipfile.py", line 1093, in _RealGetContents
raise BadZipFile("File is not a zip file")
zipfile.BadZipFile: File is not a zip file
from neural-storyteller.
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)
here, there is a possibility that the number won't end up as integer.. so should we add int() to round it up?
from neural-storyteller.
Yes, I made that change too:
int(w*256/h)
from neural-storyteller.
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.
from neural-storyteller.
Related Issues (20)
- generate story error HOT 1
- config.py
- Killed (also skip-thoughts) HOT 3
- How to create new posbias for custom encoder/decoder? HOT 2
- Skipthought.py HOT 1
- No module named theano HOT 3
- Models adjust in config.py HOT 4
- Could I use the code to generate stories for commercial uses? HOT 1
- Generator.py transform.resize error
- Random Nearest captions followed by an error HOT 5
- Embedding captions... HOT 4
- ValueError: could not broadcast input array from shape (3600) into shape (2400)
- How to modify bias to generate longer stories?
- cannot allocate memory error,and i do not know how much RAM it needs HOT 1
- Fine tuning COCO HOT 1
- Have no access to download VGG19 parameters
- No such file or directory: '../uni_skip.npz.pkl' HOT 2
- vgg19.pkl link not available HOT 7
- Error in unzipping npz files
- load_model() takes 0 positional arguments but 2 were given anyone help please
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from neural-storyteller.