-
Notifications
You must be signed in to change notification settings - Fork 91
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
Issues on creating HDF5 file #10
Comments
Besides, I use the 115-GB file to do test analyses by running the codes: "th main.lua -test 1 -loadsnap im2recipe_model.t7". I got many 150*1024 matrixes. Could you tell me how to explain it? That is, given an image, how do this matrix tell us the probability for each recognised ingredient? |
Nothing, other than that several images couldn't be loaded and were replaced with zeros instead of actual data. You should try to figure out why your images weren't loaded :)
Each matrix is a mini-batch of embeddings. There are two sets of embeddings: one for images and one for recipes. If you want to do embedding->ingredient prediction, you'll want the image embeddings and then train a new model to go from those to ingredient. I can tell you already that unless you add some special trick, it's not going to "just work." |
Hi nhynes, thanks for your answers and patience. I encountered different problems and opened this new issue. |
Sorry I want to add more details to "
Do you have any idea? Many thanks in advance! |
You ran out of CUDA (i.e. GPU memory). You need to either use more gpus using the |
Yes, you are right. I tried to set |
The demo only does one of those things. I suggest that you read the paper to get a better sense of how the model might be used for your specific application :) |
Hi nhynes, I read your paper and |
For sure! What I was saying was that you'd have a hard time directly predicting the ingredients from the embedding. You can always go im2recipe/recipe2im. |
Sorry I wonder if the |
Yes. |
Hi nhynes. Sorry it is me again. Finally I figured out how to modify the rank.py file to get the ingredient and recipe. Thanks for all above help! |
Hey @QLgogo, no worries! You're helping to expose challenges with deploying the model :) To solve the problem, generally, you'll need to sort the images by recipe id so that they are in the order given by You only want the image embeddings though, right? In that case, it's much easier: just pick the image model out of the pretrained one and feed the images through that directly. |
Hi nhynes. Yes, I only want the image embeddings and input them into So each To find out the corresponding recipes for my own images, I plan to directly replace the content of your .jpg files with the content of my .jpg files. So I need to make sure all images to be replaced is among the 51334 images. Thus, could you tell me how you code the multiple images within a test_id? That is, how to narrow down the 82392 images into 51334 images? e.g. Do you randomly select one from the multiple ones within a test_id or concatenate them? |
Since you only want the image embeddings, I highly recommend that you do not mess with the hdf5 file. Instead, try the approach of using the fine-tuned CNN directly to get the embeddings for your images. Something like this. |
Hi, QLgogo, May you share me the h5 data file, i.e., data.h5? Here is my email: [email protected] I would greatly appreciate your assistance in sharing this data. Please let me know if you can provide this data or if there are any specific procedures I should follow to access it. |
I run the code "python mk_dataset.py ..." from ./pyscripts . The screen printed the following lines:
...
Loading dataset.
Loading ingr vocab.
('Image path is:', '/home/yue_zhang/Desktop/im2recipe/data/recipe1M/images')
('H5 file is', '/home/yue_zhang/Desktop/im2recipe/data/h5/data.h5')
{'test': 100808, 'train': 471475, 'val': 100297}
Assembling dataset.
Could not load image...Using black one instead.
Could not load image...Using black one instead.
Could not load image...Using black one instead.
Could not load image...Using black one instead.
Could not load image...Using black one instead.
Could not load image...Using black one instead.
Could not load image...Using black one instead.
Could not load image...Using black one instead.
Could not load image...Using black one instead.
Could not load image...Using black one instead.
...
Could not load image...Using black one instead.
Writing out data.
However, finally a 115 GB file is produced. What is wrong with this? Can this 115-GB file be used for the next test analyses?
The text was updated successfully, but these errors were encountered: