-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't seem to get sample_speaker.py to generate text for new images #5
Comments
Hi, you are right the sample_speaker.py can be used to create captions for whatever images you want to. However, to do this you need to provide a .csv file that informs the code about which images you intend to caption. Specifically, you need to pass this .csv per the "-custom-data-csv" argument. Please have a look at the function "custom_grounding_dataset_similar_to_affective_loader" in artemis/in_out/datasets.py for more info. In a gist, the custom .csv has to include the filenames and optionally the grounding emotion (if you are using a system that takes emotion-grounding into account). Last, the error you get is about something else. It tells you that the loaded model is using a decoder with 14469 tokens. That's how many we use in the published pretrained models. Apparently, you are using here a vocabulary that contains all tokens possible for ArtEmis which won't match the one we used for training deep-nets. |
Thanks for the clarification, appreciated. I've now supplied the relevant csv. Can I ask one further question? You say:
Can I ask how I might use the right decoder so as to avoid this error? I'm using the |
Hello, sorry for the long-due reply. Did you figure it out? Judging by the numbers of your tensors, I think you are pointing via the sample_speaker.py (via the passed config.json.txt) to a local -data-dir that stores the vocabulary.pkl that you generated for analysis, and not a reduced-sized one as we do when we train deep-nets i.e., the one that will be created by running the preprocess_artemis_data.py with the --preprocess-for-deep-nets flag set to True ( in step-1). Right? If that is the case, you need to rerun the preprocess_artemis_data.py with the --preprocess-for-deep-nets True and then update the config.json.txt of the pretrained model to point to that new output directory where you will save the preprocessed results. Last, |
@optas In my experience, running the |
Hi @ege-kaya
I do not think optas has to upload the When you run his notebook
|
Did you figure this out? I'm also getting 14468 {'automatic_spell_check': True, |
Hi, |
Hello, I think I am bit late for this issue, can you help me?
Parameters Specified: Loading saved speaker trained with parameters: Thank you! |
I wish to generate caption text for images that I'll be providing. My understanding is that sample_speaker.py will do this. However, when I run it I get an error. Here's what I run in terminal, with the relevant parts of config.json.txt changed.
python sample_speaker.py -speaker-saved-args config.json.txt -speaker-checkpoint best_model.pt -img-dir image_folder -out-file /Outputs/results.pkl
When I do this, I get:
Can you advise what I'm doing wrong here? I can't quite get to the bottom of it. Thanks!
The text was updated successfully, but these errors were encountered: