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: __int__ returned non-int (type NoneType) #16

Open
SeekPoint opened this issue Oct 31, 2016 · 3 comments
Open

TypeError: __int__ returned non-int (type NoneType) #16

SeekPoint opened this issue Oct 31, 2016 · 3 comments

Comments

@SeekPoint
Copy link

andy1028@andy1028-Envy:/media/andy1028/data1t/os_prj/github/debug_seq2seq$ python bin/train.py
INFO:gensim.utils:Pattern library is not installed, lemmatization won't be available.
INFO:summa.preprocessing.cleaner:'pattern' package not found; tag filters are not available for English
Using TensorFlow backend.
I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcublas.so locally
I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcudnn.so locally
I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcufft.so locally
I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcuda.so.1 locally
I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcurand.so locally
INFO:lib.dialog_processor:Loading corpus data...
INFO:lib.dialog_processor:/var/lib/try_seq2seq/corpora_processed/movie_lines_cleaned_m1.txt and /var/lib/try_seq2seq/words_index/w_idx_movie_lines_cleaned_m1.txt exist, loading files from disk
INFO:main:-----
INFO:lib.w2v_model.w2v:Loading model from /var/lib/try_seq2seq/w2v_models/movie_lines_cleaned_w5_m1_v256.bin
INFO:gensim.utils:loading Word2Vec object from /var/lib/try_seq2seq/w2v_models/movie_lines_cleaned_w5_m1_v256.bin
INFO:gensim.utils:setting ignored attribute syn0norm to None
INFO:gensim.utils:setting ignored attribute cum_table to None
INFO:lib.w2v_model.w2v:Model "movie_lines_cleaned_w5_m1_v256.bin" has been loaded.
INFO:main:-----
INFO:lib.nn_model.model:Initializing NN model with the following params:
INFO:lib.nn_model.model:Input dimension: 256 (token vector size)
INFO:lib.nn_model.model:Hidden dimension: 512
INFO:lib.nn_model.model:Output dimension: 20001 (token dict size)
INFO:lib.nn_model.model:Input seq length: 16
INFO:lib.nn_model.model:Output seq length: 6
INFO:lib.nn_model.model:Batch size: 32
I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:925] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
I tensorflow/core/common_runtime/gpu/gpu_init.cc:102] Found device 0 with properties:
name: GeForce GTX 950M
major: 5 minor: 0 memoryClockRate (GHz) 1.124
pciBusID 0000:01:00.0
Total memory: 4.00GiB
Free memory: 3.68GiB
I tensorflow/core/common_runtime/gpu/gpu_init.cc:126] DMA: 0
I tensorflow/core/common_runtime/gpu/gpu_init.cc:136] 0: Y
I tensorflow/core/common_runtime/gpu/gpu_device.cc:839] Creating TensorFlow device (/gpu:0) -> (device: 0, name: GeForce GTX 950M, pci bus id: 0000:01:00.0)
Traceback (most recent call last):
File "bin/train.py", line 37, in
learn()
File "bin/train.py", line 30, in learn
nn_model = get_nn_model(token_dict_size=len(index_to_token))
File "/media/andy1028/data1t/os_prj/github/debug_seq2seq/lib/nn_model/model.py", line 29, in get_nn_model
depth=1
File "build/bdist.linux-x86_64/egg/seq2seq/models.py", line 77, in SimpleSeq2Seq
File "/usr/local/lib/python2.7/dist-packages/keras/models.py", line 308, in add
output_tensor = layer(self.outputs[0])
File "/usr/local/lib/python2.7/dist-packages/keras/engine/topology.py", line 514, in call
self.add_inbound_node(inbound_layers, node_indices, tensor_indices)
File "/usr/local/lib/python2.7/dist-packages/keras/engine/topology.py", line 572, in add_inbound_node
Node.create_node(self, inbound_layers, node_indices, tensor_indices)
File "/usr/local/lib/python2.7/dist-packages/keras/engine/topology.py", line 149, in create_node
output_tensors = to_list(outbound_layer.call(input_tensors[0], mask=input_masks[0]))
File "build/bdist.linux-x86_64/egg/recurrentshop/engine.py", line 305, in call
File "build/bdist.linux-x86_64/egg/recurrentshop/engine.py", line 51, in
File "/usr/local/lib/python2.7/dist-packages/keras/backend/tensorflow_backend.py", line 1175, in rnn
state_size = int(states[0].get_shape()[-1])
TypeError: int returned non-int (type NoneType)
andy1028@andy1028-Envy:/media/andy1028/data1t/os_prj/github/debug_seq2seq$

@krywykj
Copy link

krywykj commented Dec 26, 2016

Same problem here, looking for solutions.

@lekhamohan
Copy link

lekhamohan commented Sep 13, 2017

Did you get the solution for this?


  File "alexnet.py", line 120, in <module>
    main()
  File "alexnet.py", line 118, in main
    network()
  File "alexnet.py", line 101, in network
    model_info = model.fit(x =[data1,data2],y=one_hot_labels,epochs = 7000, callbacks = callbacks_list,validation_split = 0.2,batch_size =4, verbose=2 )
  File "/home/lwalajap/local/anaconda2/lib/python2.7/site-packages/keras/models.py", line 867, in fit
    initial_epoch=initial_epoch)
  File "/home/lwalajap/local/anaconda2/lib/python2.7/site-packages/keras/engine/training.py", line 1522, in fit
    batch_size=batch_size)
  File "/home/lwalajap/local/anaconda2/lib/python2.7/site-packages/keras/engine/training.py", line 1389, in _standardize_user_data
    in zip(y, sample_weights, class_weights, self._feed_sample_weight_modes)]
  File "/home/lwalajap/local/anaconda2/lib/python2.7/site-packages/keras/engine/training.py", line 561, in _standardize_weights
    return np.ones((y.shape[0],), dtype=K.floatx())
  File "/home/lwalajap/local/anaconda2/lib/python2.7/site-packages/numpy/core/numeric.py", line 192, in ones
    a = empty(shape, dtype, order)
TypeError: __index__ returned non-(int,long) (type NoneType)

Facing a similar issue

@khan008
Copy link

khan008 commented Aug 30, 2024

@lekhamohan did you get the solution please, I got the same problem???? much frustrated over the last few days due to unresolved

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

4 participants