andersbll / neural_artistic_style

Neural Artistic Style in Python
MIT License
2.18k stars 482 forks source link

TypeError?Need help #56

Open Zerahhah opened 7 years ago

Zerahhah commented 7 years ago

Dear andersbll, I run it , but i got a typeerror.Python3.5 F:\mew\neural_artistic_style-master>python neural_artistic_style.py --subject images/1.jpg --style images/2.jpg CUDArray: CUDA back-end not available, using NumPy. Traceback (most recent call last): File "neural_artistic_style.py", line 138, in run() File "neural_artistic_style.py", line 116, in run args.smoothness) File "F:\mew\neural_artistic_style-master\style_network.py", line 99, in init next_subject = layer.fprop(next_subject) File "F:\mew\neural_artistic_style-master\style_network.py", line 18, in fprop y = self.conv_op.fprop(x, self.weights.array) File "C:\Users\iDream\AppData\Local\Programs\Python\Python35\lib\site-packages\cudarray-0.1.dev0-py3.5-win-amd64.egg\cudarray\numpy_backend\nnet\conv.py", line 20, in fprop convout = ca.empty(convout_shape, dtype=imgs.dtype) TypeError: 'float' object cannot be interpreted as an integer

I am looking for your favorable reply at your convenience.Thank you.

ak2703 commented 7 years ago

Same error.

haimengzhao commented 7 years ago

Same error. Seeking for help. Thanks!

python3 neural_artistic_style.py --subject a.JPG --style images/starry_night.jpg CUDArray: CUDA back-end not available, using NumPy. Traceback (most recent call last): File "neural_artistic_style.py", line 138, in run() File "neural_artistic_style.py", line 116, in run args.smoothness) File "/Users/minhui/Downloads/neural_artistic_style-master/style_network.py", line 99, in init next_subject = layer.fprop(next_subject) File "/Users/minhui/Downloads/neural_artistic_style-master/style_network.py", line 18, in fprop y = self.conv_op.fprop(x, self.weights.array) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/cudarray-0.1.dev0-py3.6-macosx-10.6-intel.egg/cudarray/numpy_backend/nnet/conv.py", line 20, in fprop convout = ca.empty(convout_shape, dtype=imgs.dtype) TypeError: 'float' object cannot be interpreted as an integer

+++++++++++++++++++++++++++++++++++++++++++++ 2 hours later: I tried it again with python 2.7. It worked. I'm waiting for its iteration.

python neural_artistic_style.py --subject a.JPG --style images/starry_night.jpg CUDArray: CUDA back-end not available, using NumPy. Iteration: 0, cost: 43.4514 Iteration: 1, cost: 42.7667

olliejday commented 7 years ago

Same error

TylerBohrer commented 7 years ago

make sure that you have installed the right type of imagenet-vgg-verydeep-19.mat file since that what was causing the error for me.

Zerahhah commented 7 years ago

@TylerBohrer I checked its version before i put the issue, it was right. Now, i download the latest version(30-Sep-2016), but i get the same error. imagenet-vgg-verydeep-19.mat And what is your type of imagenet-vgg-verydeep-19.mat ?

fcyf commented 7 years ago

@TylerBohrer Same error,I dowload it from http://www.vlfeat.org/matconvnet/models/imagenet-vgg-verydeep-19.mat and file checksums is same. $ md5sum imagenet-vgg-verydeep-19.mat 106118b7cf60435e6d8e04f6a6dc3657 imagenet-vgg-verydeep-19.mat

AdrienLF commented 7 years ago

Same error, on mac, NOT using CUDA back end.

fPrager commented 6 years ago

Same Error here on windows, also not using cuda.

fPrager commented 6 years ago

maybe I found my problem, I had to change the numpy module to version 1.11.0 if I run the program now it also warns about this error in newer versions: "VisibleDepricationWarning: using a non-integer instead of an integer will result in an error in the future" ---> keep in mind, that if you would have the cuda back end, it wouldn't use the numpy-stuff and you don't have to change the version