mosessoh / cnn-lstm-caption-generator Goto Github PK
View Code? Open in Web Editor NEWA Tensorflow implementation of CNN-LSTM image caption generator architecture that achieves close to state-of-the-art results on the MSCOCO dataset.
A Tensorflow implementation of CNN-LSTM image caption generator architecture that achieves close to state-of-the-art results on the MSCOCO dataset.
When running eval_captions.py there is an ImportError: No module named pycocoevalcap.eval
Img: (256, 1, 512)
Sent: (256, ?, 512)
Combined: (256, ?, 512)
Traceback (most recent call last):
File "caption_image.py", line 47, in
main(sys.argv[1:])
File "caption_image.py", line 32, in main
model = Model(config)
File "/home/abc/caffe/cnnlstm/model.py", line 57, in init
lstm = tf.nn.rnn_cell.BasicLSTMCell(self.config.hidden_dim,forget_bias=1,input_size=self.config.embed_dim)
TypeError: init() got an unexpected keyword argument 'input_size'
Hey, I tried downloading it, but I am getting the above mentioned 404 Error. Can you please reupload the model?
Hi,
I am facing
**(tensorflow) [user@hostname CNN-LSTM-Caption-Generator]$ python3.4 caption_image.py -i images/pizza.jpg
File "caption_image.py", line 25
print '-'20
^
SyntaxError: Missing parentheses in call to 'print'*
this error.
I am using conda in oracle linux 6.9.
Can you suggest what I am doing wrong?
Hi, author. I trained the model on the ubuntu 14.04 with CUDA 7.5, cudnn 0.4 and tensorflow 0.10, but the returned loss is always NAN. I don't know how to fix it.
Hey, when I use your demo, and run: python caption -i images/pizza.jpg, But get the problem: "a cuda runtime call was likely performed without using a streamExecutor context" which caused by the code of "with tf.Session as session", I know it because the file use caffe to extract cnn features and causes the cuda conflicting with tensorflow , what can I do?
As the topic says, the download files are not "public" shared on google drive
Hello, I am a senior student, thank you for providing this model, I need to study this model in order to do my graduation project. But download.sh does not work, I use google to visit inside the link, return 404. So can you provide the .pkl file for this model, thanks
The connection is refused in download.sh.Can someone provide the new connection?
Hello , I got a problem like this when I ran the project:
tensorflow/core/util/tensor_slice_reader.cc:93] Could not open best_model/model-37: Data loss: not an sstable (bad magic number): perhaps your file is in a different file format and you need to use a different restore operator?
and I tried to download from google drive , it turned out that 404 error.
hi, because this model is implemented in python2, but the tensorflow installed on windows can only be based on python3.5, so the installation of this model can only be in linux?
Tensor name "CNNLSTM/LSTM/multi_rnn_cell/cell_0/basic_lstm_cell/bias" not found in checkpoint files best_model/model-37
[[Node: save/RestoreV2_2 = RestoreV2[dtypes=[DT_FLOAT], _device="/job:localhost/replica:0/task:0/cpu:0"](_arg_save/Const_0_0, save/RestoreV2_2/tensor_names, save/RestoreV2_2/shape_and_slices)]]
[[Node: save/RestoreV2_21/_33 = _Recvclient_terminated=false, recv_device="/job:localhost/replica:0/task:0/gpu:0", send_device="/job:localhost/replica:0/task:0/cpu:0", send_device_incarnation=1, tensor_name="edge_82_save/RestoreV2_21", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/gpu:0"]]
This happens when I try to run this python caption_image.py -i images/pizza.jpg
with tensorflow 1.2.0. What should I do to solve this problem? Thanks!
thanks the author! and i wanna train new model , but don't know how to do it, could you please tell me or give a insutruction in the readme file?
I use the downloaded 'pkl' files your provided, and when loading them, I have encountered some issues:
with open('data_files/train_image_id2feature.pkl','rb') as f:
self.train_image_id2feature = pickle.load(f)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd2 in position 1: ordinal not in range(128)
if I add 'encoding='latin1'
, another error raises:
with open('data_files/train_image_id2feature.pkl','rb') as f:
self.train_image_id2feature = pickle.load(f, encoding='latin1')
_pickle.UnpicklingError: pickle data was truncated
val_image_id2feature.pkl
also has the same problem
but index2token.pkl
, preprocessed_train_captions.pkl
files can be read successfully use the same way.
I use Python3.6, can you tell me how to solve it, and can you provide the original code to generate 'pkl' files?
Thank you very much!
When I run the caption-image file I am getting the following error
Img: (256, 1, 512)
Sent: (256, ?, 512)
Traceback (most recent call last):
File "caption_image.py", line 47, in
main(sys.argv[1:])
File "caption_image.py", line 32, in main
model = Model(config)
File "/home/abc/caffe/cnnlstm/model.py", line 52, in init
all_inputs = tf.concat(1, [img_input, sent_inputs])
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/array_ops.py", line 1127, in concat
dtype=dtypes.int32).get_shape().assert_is_compatible_with(
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 932, in convert_to_tensor
as_ref=False)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 1022, in internal_convert_to_tensor
ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/constant_op.py", line 233, in _constant_tensor_conversion_function
return constant(v, dtype=dtype, name=name)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/constant_op.py", line 212, in constant
value, dtype=dtype, shape=shape, verify_shape=verify_shape))
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/tensor_util.py", line 413, in make_tensor_proto
_AssertCompatible(values, dtype)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/tensor_util.py", line 328, in _AssertCompatible
(dtype.name, repr(mismatch), type(mismatch).name))
TypeError: Expected int32, got list containing Tensors of type '_Message' instead.
Please someone help me resolve this
I'm very interested in your work and I try to run it. But I got <Failed to parse NetParameter file: /home/nemare/caffe-master/models/bvlc_googlenet/bvlc_googlenet.caffemodel> error.
I already downloaded bvlc_googlenet.caffemodel. Could you tell me how to solve this problem.
WARNING: Logging before InitGoogleLogging() is written to STDERR
F0727 14:30:36.093981 19138 upgrade_proto.cpp:86] Check failed: ReadProtoFromBinaryFile(param_file, param) Failed to parse NetParameter file: /home/nemare/caffe-master/models/bvlc_googlenet/bvlc_googlenet.caffemodel
*** Check failure stack trace: ***
Aborted (core dumped)
rzai@rzai00:/prj/CNN-LSTM-Caption-Generator$ bash download.sh/prj/CNN-LSTM-Caption-Generator$
--2016-12-20 10:33:35-- https://googledrive.com/host/0B8-CPllE3RJqaHlRTWxxSTI3cW8/index2token.pkl
Resolving googledrive.com (googledrive.com)... 172.217.24.1, 2404:6800:4008:803::2001
Connecting to googledrive.com (googledrive.com)|172.217.24.1|:443... failed: Connection refused.
Connecting to googledrive.com (googledrive.com)|2404:6800:4008:803::2001|:443... failed: Network is unreachable.
--2016-12-20 10:34:38-- https://googledrive.com/host/0B8-CPllE3RJqaHlRTWxxSTI3cW8/preprocessed_train_captions.pkl
Resolving googledrive.com (googledrive.com)... 216.58.200.225, 2404:6800:4008:803::2001
Connecting to googledrive.com (googledrive.com)|216.58.200.225|:443... failed: Connection refused.
Connecting to googledrive.com (googledrive.com)|2404:6800:4008:803::2001|:443... failed: Network is unreachable.
--2016-12-20 10:35:41-- https://googledrive.com/host/0B8-CPllE3RJqaHlRTWxxSTI3cW8/train_image_id2feature.pkl
Resolving googledrive.com (googledrive.com)... 216.58.200.225, 2404:6800:4008:803::2001
Connecting to googledrive.com (googledrive.com)|216.58.200.225|:443... failed: Connection refused.
Connecting to googledrive.com (googledrive.com)|2404:6800:4008:803::2001|:443... failed: Network is unreachable.
--2016-12-20 10:36:44-- https://googledrive.com/host/0B8-CPllE3RJqaHlRTWxxSTI3cW8/val_image_id2feature.pkl
Resolving googledrive.com (googledrive.com)... 216.58.200.225, 2404:6800:4008:803::2001
Connecting to googledrive.com (googledrive.com)|216.58.200.225|:443... failed: Connection refused.
Connecting to googledrive.com (googledrive.com)|2404:6800:4008:803::2001|:443... failed: Network is unreachable.
--2016-12-20 10:37:47-- https://googledrive.com/host/0B8-CPllE3RJqaHlRTWxxSTI3cW8/checkpoint
Resolving googledrive.com (googledrive.com)... 216.58.200.225, 2404:6800:4008:803::2001
Connecting to googledrive.com (googledrive.com)|216.58.200.225|:443... failed: Connection refused.
Connecting to googledrive.com (googledrive.com)|2404:6800:4008:803::2001|:443... failed: Network is unreachable.
--2016-12-20 10:38:50-- https://googledrive.com/host/0B8-CPllE3RJqaHlRTWxxSTI3cW8/model-37
Resolving googledrive.com (googledrive.com)... 216.58.200.225, 2404:6800:4008:803::2001
Connecting to googledrive.com (googledrive.com)|216.58.200.225|:443... failed: Connection refused.
Connecting to googledrive.com (googledrive.com)|2404:6800:4008:803::2001|:443... failed: Network is unreachable.
--2016-12-20 10:39:52-- https://googledrive.com/host/0B8-CPllE3RJqaHlRTWxxSTI3cW8/model-37.meta
Resolving googledrive.com (googledrive.com)... 172.217.24.1, 2404:6800:4008:803::2001
Connecting to googledrive.com (googledrive.com)|172.217.24.1|:443... failed: Connection refused.
Connecting to googledrive.com (googledrive.com)|2404:6800:4008:803::2001|:443... failed: Network is unreachable.
rzai@rzai00:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.