anuragmishracse / caption_generator

A modular library built on top of Keras and TensorFlow to generate a caption in natural language for any input image.
MIT License
265 stars 120 forks source link

Running on Mac OS X (10.12.6) #12

Closed crowoy closed 6 years ago

crowoy commented 6 years ago

I would like to get this running on my local machine before pushing it up to Google Compute Engine.

I setup a new virtual environment, and cloned the repo. I then ran pip install -r requirements.txt and everything installed correctly.

I then tried running python caption_generator/prepare_dataset.py and get the following error:

Using TensorFlow backend.
Traceback (most recent call last):
  File "prepare_dataset.py", line 5, in <module>
    from imagenet_utils import preprocess_input
ImportError: No module named imagenet_utils

I was under the impression that imagenet_utils was included in Keras?

crowoy commented 6 years ago

I am using Python 2.7.10.

anuragmishracse commented 6 years ago

Hi @crowoy , you're correct. imagenet_utils is included in keras. I was using the file separately before. I am surprised that nobody pointed out this issue before. Anyway, I've updated the prepare_dataset.py to use the keras file. You can pull the changes and retry!

crowoy commented 6 years ago

@anuragmishracse, thank you for the quick response, and for fixing the issue.

How long can I expect the training to take on a CPU? And would it be possible to adapt the program to work with the Flickr30k dataset? I assume much better results would be achieved.

anuragmishracse commented 6 years ago

On a CPU - it would take days. Try getting a GPU and train; you'll be able to get reasonably good captions in day.

Yes you can do it. In fact, make that dataset in the form of Flickr8k and you wouldn't need to modify the programs at all. In a different issue, people have tried on the Flickr30 set, I would suggest you ping them in case you need help.

Also, I am closing this issue. You can reopen it if the need arises.