Comments (22)
@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!!
- In the first case was during training phase and it was because of wrong path problem. I added the images to subfolder inside the folder declared in the config.
so, the code while creating the images object created them without actual image source!! So i solved it by fixing the images folder path. - The second case was during testing phase. when I debugged it i noticed that there are names of images that actually not exist in the testing images folder!! to be honest i don't know why or where they came from i just replaced the folder with newly created one and moved the testing images to it and it worked!!
from image_captioning.
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.
from image_captioning.
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.
from image_captioning.
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.
from image_captioning.
@NoohAzhar pls, be detailed...I cannot understand
from image_captioning.
@NoohAzhar sry,my fault. there has chinese characters in test img name...LOL
from image_captioning.
thanks @NoohAzhar
from image_captioning.
@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 "", line 80, in
tf.app.run()
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\platform\app.py", line 125, in run
_sys.exit(main(argv))
File "", line 60, in main
model.train(sess, data)
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'
from image_captioning.
@AnwarUllahKhan I would recommend you to check the following:
- Images in correct path
- Images name doesn’t have Chinese, korean, Arabic ... etc characters
- The images format ( jpg, jpeg)
- Images folder is clean from other type of files
from image_captioning.
- My images are in the correct path which is mention on the config file. self.train_image_dir = './train/images/'
- Images name is same as coco dataset like COCO_train2014_000000581712.jpg etc
- all images in jpg format.
- The images folder have built-in one file "readme" can I delete that one?
highly recommended your reply....
from image_captioning.
@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
from image_captioning.
@NoohAzhar dear, If you have this code then share it with me, thank you very much. my email id is [email protected]
from image_captioning.
@AnwarUllahKhan I didn’t made any changes on the code, Just downloaded from here!!!
from image_captioning.
@NoohAzhar just show me your path how you assign the path? I am still facing the problem, I am trying from too many days....
from image_captioning.
@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?
from image_captioning.
@AnwarUllahKhan did you solve the problem?i am confused too.
from image_captioning.
@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.
from image_captioning.
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.
from image_captioning.
路径问题
from image_captioning.
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.
from image_captioning.
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
from image_captioning.
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.
from image_captioning.
Related Issues (20)
- long time to train the cnn and rnn
- cannot get good results with the pretrained model. Is there someone could provided your model to me? HOT 1
- How to replace the word_embedded layer in the model with a trained word 2vec (512 dimensions per word)?
- Question :: Python 3.7 with tensorflow? HOT 6
- Pretrained model efficiency
- beam_Search and batchsize
- FileNotFoundError: [Errno 2] No such file or directory: "'./models/vgg16_no_fc.npy'\\" HOT 1
- Support python3.7, TensorFlow1.14, numpy 1.17.2, Model download link HOT 1
- SystemError: <built-in function imread> returned NULL without setting an error HOT 3
- SystemError in test phase: <TypeError: a bytes-like object is required, not 'str'> HOT 2
- How can I train the model with my own data HOT 1
- why can't I get any result HOT 1
- How long need to spend? HOT 9
- Chinese image caption, In the result, multiple words of the same type appear HOT 1
- FileNotFoundError: [Errno 2] No such file or directory: "'./models/289999.npy'"
- No captions generated while testing
- Tensorflow version
- SystemError: <built-in function imread> returned NULL without setting an error
- How to get the txt result?
- How to visualize the results of the attention mechanism?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from image_captioning.