Open pranjalnaman opened 6 years ago
I had the same error! The problem was that the train/val images weren't in the same directory that was specified in the config file. So, please check that.
@NoohAzhar pls, be detailed...I cannot understand
@lfydegithub Several reasons could cause this error. In my case i faced it 2 times with this source code, and both times were the reason is that the images object weren't created correctly!!
@NoohAzhar sry,my fault. there has chinese characters in test img name...LOL
thanks @NoohAzhar
@NoohAzhar I am facing the same problem please give me some details about thar how can I solve that?
CNN built. Building the RNN... RNN built. 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 "
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\platform\app.py", line 125, in run _sys.exit(main(argv))
File "
File "H:\First Neural Network\image_captioning-master\base_model.py", line 46, in train images = self.image_loader.load_images('./train/images')
File "H:\First Neural Network\image_captioning-master\utils\misc.py", line 34, in load_images images.append(self.load_image(image_file))
File "H:\First Neural Network\image_captioning-master\utils\misc.py", line 18, in load_image temp = image.swapaxes(0, 2)
AttributeError: 'NoneType' object has no attribute 'swapaxes'
@AnwarUllahKhan I would recommend you to check the following:
@NoohAzhar
highly recommended your reply....
@AnwarUllahKhan I’m not really sure but yes try to delete that readme file . If it didn’t work maybe some debugging could be helpful
@NoohAzhar dear, If you have this code then share it with me, thank you very much. my email id is anwarullah0343@gmail.com
@AnwarUllahKhan I didn’t made any changes on the code, Just downloaded from here!!!
@NoohAzhar just show me your path how you assign the path? I am still facing the problem, I am trying from too many days....
@NoohAzhar how much time it's taking to train? Please tell me as soon as possible. How much time does it take when you train it?
@AnwarUllahKhan did you solve the problem?i am confused too.
@NoohAzhar how much time it's taking to train? Please tell me as soon as possible. How much time does it take when you train it?
how do you solve the problem? I have the same problem like you and I check the path many times. I don't know where is wrong, please help me.
I solve the problem. If someone meet the same problem, you just need to check your image_path. And it's sure that the images folder directly include images. Modifying the path of config is useless.
I solve this problem by redoing ‘Put the COCO train2014 images in the folder train/images’ this move again.Because you may didn't copy it completely.Just wait for copying completed.
路径问题
I also face with this problem. If anybody has a solution, let me know. I check the image path but not okay. May I know the solution.
I also face with this problem. If anybody has a solution, let me know. I check the image path but not okay. May I know the solution.
maybe you should delete the cache files in ./train ./test ./val
I have the same problem.
In my case, I unzip the train and val images into the sub folder train2014
and test2014
. Though I modified the file config.py
, I got the same error as mentioned above.
Only when I copy all the train images into train/images/
and all the val images into val/images/
, it works.
Move the images from ./train/images/train2014
to ./train/images
Like wise do for validation images, ie. from ./val/images/val2014
to ./val/images
If you are on linux based system.
cd ./train/images/train2014
The do this:
!find . -maxdepth 1 -exec mv {} .. \;
Do the same for val.
How do I get around this error: Traceback (most recent call last): File "main.py", line 69, in
tf.app.run()
File "C:\Python36\lib\site-packages\tensorflow\python\platform\app.py", line 126, in run
_sys.exit(main(argv))
File "main.py", line 50, in main
model.train(sess, data)
File "C:\Users\pranj\Desktop\img_cap\base_model.py", line 50, in train
images = self.image_loader.load_images(image_files)
File "C:\Users\pranj\Desktop\img_cap\utils\misc.py", line 35, in load_images
images.append(self.load_image(image_file))
File "C:\Users\pranj\Desktop\img_cap\utils\misc.py", line 19, in load_image
temp = image.swapaxes(0, 2)
AttributeError: 'NoneType' object has no attribute 'swapaxes'