Code Monkey home page Code Monkey logo

Comments (22)

NoohAzhar avatar NoohAzhar commented on May 27, 2024 2

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

  1. 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.
  2. 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.

Kinghup avatar Kinghup commented on May 27, 2024 1

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.

lenhhoxung86 avatar lenhhoxung86 commented on May 27, 2024 1

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.

NoohAzhar avatar NoohAzhar commented on May 27, 2024

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.

lfydegithub avatar lfydegithub commented on May 27, 2024

@NoohAzhar pls, be detailed...I cannot understand

from image_captioning.

lfydegithub avatar lfydegithub commented on May 27, 2024

@NoohAzhar sry,my fault. there has chinese characters in test img name...LOL

from image_captioning.

liujiangtaoyd avatar liujiangtaoyd commented on May 27, 2024

thanks @NoohAzhar

from image_captioning.

AnwarUllahKhan avatar AnwarUllahKhan commented on May 27, 2024

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

NoohAzhar avatar NoohAzhar commented on May 27, 2024

@AnwarUllahKhan I would recommend you to check the following:

  1. Images in correct path
  2. Images name doesn’t have Chinese, korean, Arabic ... etc characters
  3. The images format ( jpg, jpeg)
  4. Images folder is clean from other type of files

from image_captioning.

AnwarUllahKhan avatar AnwarUllahKhan commented on May 27, 2024

@NoohAzhar

  1. My images are in the correct path which is mention on the config file. self.train_image_dir = './train/images/'
  2. Images name is same as coco dataset like COCO_train2014_000000581712.jpg etc
  3. all images in jpg format.
  4. The images folder have built-in one file "readme" can I delete that one?

highly recommended your reply....

from image_captioning.

NoohAzhar avatar NoohAzhar commented on May 27, 2024

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

AnwarUllahKhan avatar AnwarUllahKhan commented on May 27, 2024

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

NoohAzhar avatar NoohAzhar commented on May 27, 2024

@AnwarUllahKhan I didn’t made any changes on the code, Just downloaded from here!!!

from image_captioning.

AnwarUllahKhan avatar AnwarUllahKhan commented on May 27, 2024

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

AnwarUllahKhan avatar AnwarUllahKhan commented on May 27, 2024

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

kangkang59812 avatar kangkang59812 commented on May 27, 2024

@AnwarUllahKhan did you solve the problem?i am confused too.

from image_captioning.

Kinghup avatar Kinghup commented on May 27, 2024

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

56518 avatar 56518 commented on May 27, 2024

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.

mymuli avatar mymuli commented on May 27, 2024

路径问题

from image_captioning.

phyukhaing7 avatar phyukhaing7 commented on May 27, 2024

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.

skywangch avatar skywangch commented on May 27, 2024

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.

ayulockin avatar ayulockin commented on May 27, 2024

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.

Reference: https://superuser.com/questions/88202/how-do-i-move-files-and-directories-to-the-parent-folder-in-linux

from image_captioning.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.