-
Notifications
You must be signed in to change notification settings - Fork 76
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 evaluate KeyError: 'query_f'` #26
Comments
Do you run this code to get a st model? python3 gen_st_model_market.py --name ft_ResNet50_pcb_market_e --data_dir "/home/huangpg/st-reid/dataset/market_rename/" |
No I used the pretrained model |
If you could please answer this it will help me run it |
All of the steps are shown in readme.md. If you do not want to re-train a model. I suggest you carefully follow these steps:
|
Ok let me try them now as I dont want to re-train a model |
For anyone running this on Windows replace line 147 in |
@Wanggcong I am running out of memory on running step 3 above, I am not sure what this will output. If its going to create a model that I can use in step 4 then can you please provide that model for me to evaluate? I am just using this for eval at the moment so really need some quick help. |
You could use small batchsize for test if it occurs " out of memory". For example, python3 test_st_market.py --PCB --gpu_ids 2 --name A --test_dir "/home/huangpg/st-reid/dataset/market_rename/" --batchsize 1 |
Step 3 is not a model, it is used for feature extraction for images. |
Nope still not working with batch sizes of 4,2 and 1 |
Pretrained models are already released in readme.md. (both google drive or baidu). No other pretrained models! And the steps are clear. I think some errors are not about my code. |
If you want to apply this code to your scenario, I think you could re-train the st (spatial-temporal) model. Because different scenarios have different st relationships. Directly using this code for your scenario could not work. |
@Wanggcong Makes sense but I dont have test data :( |
@Wanggcong I downloaded |
Without some important information, I afraid it is difficult for me to give you a good suggestion. You may try python -mpdb xxx.py for debugging the code and find the key problem. But this could be out of range of my code. |
I didnt change any of your code, I just grab your weights and run your file then got the above error, what do you want me to try? |
Do you have a GPU in your computer? How much is the memory? I confirm my code many times, there is no error like "out of memory" if setting batch size to 1 |
@Wanggcong I have a 1060 and I am not extracting features, I am using |
How about the step 3? You could have to rename the dataset when preparing the dataset, as described in readme.md. ''' change the path of dataset |
I skipped step 3 because even with a batch size of 1 I am getting out of memory error |
No, you have to extract features. '.mat' file is a st model and '.pth' is net weight. |
ok can you please share the extracted features then and show me how to use it? because acquiring better hardware is out of the question for me right now so all I got is 16Gb RAM and 1060 |
No problem. Extracted features will upload. |
Thank you and please show how to use them to match images, I have to use them in a video |
Features will be uploaded into https://pan.baidu.com/s/1QMp22dVGJvBH45e4XPdeKw |
Ok that makes sense, the code only works on your own dataset. Thanks for explaining that, I would still try your model once ready on my own data |
Dear Guangcong Thanks for sharing your valuables implementation of your paper. I read your “readme” files and FAQ in GitHub. I am new in python and it is rather wage for me. I just want to test your code for some query images of market-1501. I have downloaded this data set before. Would you please tell me what exactly I must to do? Thank you very much and looking forward to hearing you. Regards Hossein |
@khodabakhshih A. If you do not want to re-train a model, you can use our trained models, please read the discussion above. I summarize it as follows.One key point is changing the paths, as shown in bold below. --data prepare or use my extracted features https://pan.baidu.com/s/1QMp22dVGJvBH45e4XPdeKw. --evaluate (joint metric, you can use your own visual feature or spatial-temporal streams) B. If you want to re-train the model, I think you just follow the third point (3. experiment) in my readme files (copied in the following), and do it step by step. One key point is changing the paths, shown in bold below.--data prepare change the path of dataset --test (appearance feature extraction) --generate st model (spatial-temporal distribution) --evaluate (joint metric, you can use your own visual feature or spatial-temporal streams) --re-rank Best wishes, Guangcong |
@Wanggcong Thank you in advance. |
Hi |
@Wanggcong hi,can i use this model without gpu? if it is possible,what should i do? |
你好,你训练好的这个模型是可以直接用吧?我看了别人提的问题和你的回答,现在有个需求,就是想用这个模型识别视频里面的特定的人,看了会儿,有点懵,可以说说怎么搞吗?我英文贼菜。 |
--模型针对对应的数据集,如果要换数据集,需要重新训练,包括视觉特征和时空分布统计。 |
Hello Wanggcong |
You can try to decrease the number of dataloader workers at test_st_duke.py. |
I am running the
python evaluate_st.py --name market1501
but I receive the following errorTraceback (most recent call last): File "evaluate_st.py", line 149, in <module> query_feature = result['query_f'] KeyError: 'query_f'
when I print the
result
I get this`{'header': b'MATLAB 5.0 MAT-file Platform: posix, Created on: Thu Jun 6 22:53:34 2019', 'version': '1.0', 'globals': [], 'distribution': array([[[0. , 0. , 0. , ..., 0. ,
0. , 0. ],
[0.00527704, 0.00263852, 0.00791557, ..., 0. ,
0. , 0. ],
[0.06461538, 0.09230769, 0.07384615, ..., 0. ,
0. , 0. ],
...,
[0.00226757, 0.00453515, 0.00680272, ..., 0. ,
0. , 0. ],
[0. , 0. , 0. , ..., 0. ,
0. , 0. ],
[0. , 0. , 0. , ..., 0. ,
0. , 0. ]],
The text was updated successfully, but these errors were encountered: