Skip to content
This repository has been archived by the owner on Feb 17, 2022. It is now read-only.

problem while generating features at convfeatures.py #38

Open
Soumennn opened this issue Apr 9, 2019 · 11 comments
Open

problem while generating features at convfeatures.py #38

Soumennn opened this issue Apr 9, 2019 · 11 comments

Comments

@Soumennn
Copy link

Soumennn commented Apr 9, 2019

NotFoundError (see above for traceback): flickr30k_images/ff1000092795.jpg; No such file or directory
[[node ReadFile (defined at convfeatures.py:24) ]]
[[node DecodeJpeg (defined at convfeatures.py:25) ]]
Screenshot from 2019-04-09 12-37-30

please help me with this issue as i am trying to make my college project with this. Also a python3 version migration would have helped a lot.

@dljzx
Copy link

dljzx commented Apr 10, 2019

Same error

@aayux
Copy link
Member

aayux commented May 1, 2019

Is it possible for you to share the traceback for this error?

@sreenupadidapu
Copy link

sreenupadidapu commented May 21, 2019

when you run that command plz try this one
python2 convfeatures.py --data_path Dataset/flickr30k-images/ --inception_path ConvNets/inception_v4.pb
i hope this will work fine.
thank you

@dljzx
Copy link

dljzx commented May 22, 2019

when you run that command plz try this one
python2 convfeatures.py --data_path Dataset/flickr30k-images/ --inception_path ConvNets/inception_v4.pb
i hope this will work fine.
thank you

Thank you ! I found there was a '/' lost behind data_path , but still an IndexError in main.py --mode train
Traceback (most recent call last):
File "main.py", line 66, in
features, captions = training_data[:, 0], training_data[:, 1]
IndexError: too many indices for array
Could you help me solve that question? Thanks a lot.

@sreenupadidapu
Copy link

sreenupadidapu commented May 22, 2019 via email

@dljzx
Copy link

dljzx commented May 22, 2019

could you please send me the lines from 62 to 71 Sreenu.Padidapu, Jr,Software Engineer, Aadhya Analytics, 2-39,Old SBI Road, Sri nagar colony, Gannavaram-521101.

On Wed, May 22, 2019 at 10:05 AM dljzx @.***> wrote: when you run that command plz try this one python2 convfeatures.py --data_path Dataset/flickr30k-images/ --inception_path ConvNets/inception_v4.pb i hope this will work fine. thank you Thank you ! I found there was a '/' lost behind data_path , but still an IndexError in main.py --mode train Traceback (most recent call last): File "main.py", line 66, in features, captions = training_data[:, 0], training_data[:, 1] IndexError: too many indices for array Could you help me solve that question? Thanks a lot. — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#38?email_source=notifications&email_token=AKDKCK3XIQGJAXAU7AXZVGLPWTERXA5CNFSM4HEPBIZ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODV5323Y#issuecomment-494648687>, or mute the thread https://github.com/notifications/unsubscribe-auth/AKDKCK7WAW6H5II7KN547GTPWTERXANCNFSM4HEPBIZQ .

if config.mode == "train":
vocab, wtoidx, training_data = generate_captions(
config.word_threshold, config.max_len, args.caption_path, args.feature_path,
config.data_is_coco)
features, captions = training_data[:, 0], training_data[:, 1]
features = np.array([feat.astype(float) for feat in features])
data = (vocab.tolist(), wtoidx.tolist(), features, captions)
model = Caption_Generator(config, data=data)
loss, inp_dict = model.build_train_graph()
model.train(loss, inp_dict)

These are the lines you need. It is so kind of you to respond me so quick.

@sreenupadidapu
Copy link

sreenupadidapu commented May 22, 2019 via email

@dljzx
Copy link

dljzx commented May 22, 2019

i think all are correct here could you send me the caption_generator.py file it will more helpful for me. Thanks, Sreenu.Padidapu, Jr,Software Engineer, Aadhya Analytics, 2-39,Old SBI Road, Sri nagar colony, Gannavaram-521101.

On Wed, May 22, 2019 at 10:17 AM dljzx @.> wrote: could you please send me the lines from 62 to 71 Sreenu.Padidapu, Jr,Software Engineer, Aadhya Analytics, 2-39,Old SBI Road, Sri nagar colony, Gannavaram-521101. … <#m_7082800599257854298_> On Wed, May 22, 2019 at 10:05 AM dljzx @.> wrote: when you run that command plz try this one python2 convfeatures.py --data_path Dataset/flickr30k-images/ --inception_path ConvNets/inception_v4.pb i hope this will work fine. thank you Thank you ! I found there was a '/' lost behind data_path , but still an IndexError in main.py --mode train Traceback (most recent call last): File "main.py", line 66, in features, captions = training_data[:, 0], training_data[:, 1] IndexError: too many indices for array Could you help me solve that question? Thanks a lot. — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#38 <#38>?email_source=notifications&email_token=AKDKCK3XIQGJAXAU7AXZVGLPWTERXA5CNFSM4HEPBIZ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODV5323Y#issuecomment-494648687>, or mute the thread https://github.com/notifications/unsubscribe-auth/AKDKCK7WAW6H5II7KN547GTPWTERXANCNFSM4HEPBIZQ . if config.mode == "train": vocab, wtoidx, training_data = generate_captions( config.word_threshold, config.max_len, args.caption_path, args.feature_path, config.data_is_coco) features, captions = training_data[:, 0], training_data[:, 1] features = np.array([feat.astype(float) for feat in features]) data = (vocab.tolist(), wtoidx.tolist(), features, captions) model = Caption_Generator(config, data=data) loss, inp_dict = model.build_train_graph() model.train(loss, inp_dict) These are the lines you need. It is so kind of you to respond me so quick. — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#38?email_source=notifications&email_token=AKDKCK5EDPVKJIRICLRK4Q3PWTF5JA5CNFSM4HEPBIZ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODV54JKI#issuecomment-494650537>, or mute the thread https://github.com/notifications/unsubscribe-auth/AKDKCK2GBKH4PMLSW6XFE4DPWTF5JANCNFSM4HEPBIZQ .

caption_generator.zip
Here is caption_generator.py

@sreenupadidapu
Copy link

sreenupadidapu commented May 22, 2019 via email

@dljzx
Copy link

dljzx commented May 22, 2019

instead of that file plz replace this one
...

Thank you for your effort. I have tried your code but still the same error...

@aayux
Copy link
Member

aayux commented May 27, 2019

when you run that command plz try this one
python2 convfeatures.py --data_path Dataset/flickr30k-images/ --inception_path ConvNets/inception_v4.pb
i hope this will work fine.
thank you

Thank you ! I found there was a '/' lost behind data_path , but still an IndexError in main.py --mode train
Traceback (most recent call last):
File "main.py", line 66, in
features, captions = training_data[:, 0], training_data[:, 1]
IndexError: too many indices for array
Could you help me solve that question? Thanks a lot.

It appears that training_data is only one-dimensional. Although, I am not sure why that should be the case.

You should try verifying the shape of training_data, and whether features and captions are being assigned correct values.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants