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

AttributeError: 'NoneType' object has no attribute 'swapaxes' #57

Open
phyukhaing7 opened this issue May 21, 2019 · 1 comment
Open

Comments

@phyukhaing7
Copy link

I found the following error when running the main.py.

D:\Anaconda3\envs\KerasIntepreter\python.exe C:/Users/Dell/Downloads/Compressed/image_captioning-master/main.py
2019-05-21 16:33:16.587042: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2
2019-05-21 16:33:16.589173: I tensorflow/core/common_runtime/process_util.cc:71] Creating new thread pool with default inter op setting: 8. Tune using inter_op_parallelism_threads for best performance.
loading annotations into memory...
Done (t=1.07s)
creating index...
0%| | 0/591753 [00:00<?, ?it/s]index created!
Filtering the captions by length...
100%|██████████| 591753/591753 [01:09<00:00, 8493.74it/s]
creating index...
index created!
Building the vocabulary...
0%| | 0/585745 [00:00<?, ?it/s]Vocabulary built.
Number of words = 5000
Filtering the captions by words...
100%|██████████| 585745/585745 [01:15<00:00, 7721.86it/s]
creating index...
index created!
Processing the captions...
Captions processed.
Number of captions = 361260
Building the dataset...
Dataset built.
WARNING:tensorflow:From D:\Anaconda3\envs\KerasIntepreter\lib\site-packages\tensorflow\python\framework\op_def_library.py:263: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version.
Instructions for updating:
Colocations handled automatically by placer.
Building the CNN...
WARNING:tensorflow:From C:\Users\Dell\Downloads\Compressed\image_captioning-master\utils\nn.py:70: conv2d (from tensorflow.python.layers.convolutional) is deprecated and will be removed in a future version.
Instructions for updating:
Use keras.layers.conv2d instead.
WARNING:tensorflow:From C:\Users\Dell\Downloads\Compressed\image_captioning-master\utils\nn.py:83: max_pooling2d (from tensorflow.python.layers.pooling) is deprecated and will be removed in a future version.
Instructions for updating:
Use keras.layers.max_pooling2d instead.
CNN built.
Building the RNN...
WARNING:tensorflow:From C:\Users\Dell\Downloads\Compressed\image_captioning-master\model.py:230: LSTMCell.init (from tensorflow.python.ops.rnn_cell_impl) is deprecated and will be removed in a future version.
Instructions for updating:
This class is equivalent as tf.keras.layers.LSTMCell, and will be replaced by that in Tensorflow 2.0.
WARNING:tensorflow:From C:\Users\Dell\Downloads\Compressed\image_captioning-master\utils\nn.py:114: dropout (from tensorflow.python.layers.core) is deprecated and will be removed in a future version.
Instructions for updating:
Use keras.layers.dropout instead.
WARNING:tensorflow:From D:\Anaconda3\envs\KerasIntepreter\lib\site-packages\tensorflow\python\keras\layers\core.py:143: calling dropout (from tensorflow.python.ops.nn_ops) with keep_prob is deprecated and will be removed in a future version.
Instructions for updating:
Please use rate instead of keep_prob. Rate should be set to rate = 1 - keep_prob.
WARNING:tensorflow:From C:\Users\Dell\Downloads\Compressed\image_captioning-master\utils\nn.py:105: dense (from tensorflow.python.layers.core) is deprecated and will be removed in a future version.
Instructions for updating:
Use keras.layers.dense instead.
RNN built.
WARNING:tensorflow:From D:\Anaconda3\envs\KerasIntepreter\lib\site-packages\tensorflow\python\ops\math_ops.py:3066: to_int32 (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.cast instead.
Training the model...
epoch: 0%| | 0/100 [00:00<?, ?it/s]
batch: 0%| | 0/11290 [00:00<?, ?it/s]
Traceback (most recent call last):
File "C:/Users/Dell/Downloads/Compressed/image_captioning-master/main.py", line 69, in
tf.app.run()
File "D:\Anaconda3\envs\KerasIntepreter\lib\site-packages\tensorflow\python\platform\app.py", line 125, in run
_sys.exit(main(argv))
File "C:/Users/Dell/Downloads/Compressed/image_captioning-master/main.py", line 50, in main
model.train(sess, data)
File "C:\Users\Dell\Downloads\Compressed\image_captioning-master\base_model.py", line 47, in train
images = self.image_loader.load_images(image_files)
File "C:\Users\Dell\Downloads\Compressed\image_captioning-master\utils\misc.py", line 34, in load_images
images.append(self.load_image(image_file))
File "C:\Users\Dell\Downloads\Compressed\image_captioning-master\utils\misc.py", line 18, in load_image
temp = image.swapaxes(0, 2)
AttributeError: 'NoneType' object has no attribute 'swapaxes'

@ssusie
Copy link

ssusie commented May 29, 2019

See the answer here

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

2 participants