neural_artistic_style icon indicating copy to clipboard operation
neural_artistic_style copied to clipboard

TypeError?Need help

Open Zerahhah opened this issue 8 years ago • 9 comments

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.

Zerahhah avatar Dec 30 '16 01:12 Zerahhah

Same error.

ak2703 avatar Jan 21 '17 16:01 ak2703

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

haimengzhao avatar Feb 03 '17 11:02 haimengzhao

Same error

olliejday avatar Feb 04 '17 18:02 olliejday

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.

TylerBohrer avatar Mar 09 '17 23:03 TylerBohrer

@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 ?

Zerahhah avatar Mar 10 '17 07:03 Zerahhah

@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

fcyf avatar Mar 26 '17 13:03 fcyf

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

AdrienLF avatar Jul 18 '17 16:07 AdrienLF

Same Error here on windows, also not using cuda.

fPrager avatar Nov 18 '17 20:11 fPrager

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

fPrager avatar Nov 18 '17 23:11 fPrager