Skip to content
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

About error of aim #5

Open
chenqs1995 opened this issue Dec 7, 2023 · 8 comments
Open

About error of aim #5

chenqs1995 opened this issue Dec 7, 2023 · 8 comments

Comments

@chenqs1995
Copy link

I encountered the following error during operation, how to solve it?

Epoch[1] Complete. Time taken: 00:01:00
Engine run complete. Time taken 00:01:00
Engine run is terminating due to exception: 'Engine' object has no attribute 'aim'
Traceback (most recent call last):
File "/home/T3090U2/project/CQS/code/infrared/SAAI/train.py", line 219, in
train(cfg)
File "/home/T3090U2/project/CQS/code/infrared/SAAI/train.py", line 153, in train
engine.run(train_loader, max_epochs=cfg.num_epoch)
File "/home/T3090U2/anaconda3/envs/saai/lib/python3.10/site-packages/ignite/engine/engine.py", line 326, in run
self._handle_exception(e)
File "/home/T3090U2/anaconda3/envs/saai/lib/python3.10/site-packages/ignite/engine/engine.py", line 291, in _handle_exception
raise e
File "/home/T3090U2/anaconda3/envs/saai/lib/python3.10/site-packages/ignite/engine/engine.py", line 317, in run
self._fire_event(Events.EPOCH_COMPLETED)
File "/home/T3090U2/anaconda3/envs/saai/lib/python3.10/site-packages/ignite/engine/engine.py", line 226, in _fire_event
func(self, *(event_args + args), **kwargs)
File "/home/T3090U2/project/CQS/code/infrared/SAAI/engine/init.py", line 150, in epoch_completed_callback
mAP, r1, r5, _, _ = eval_sysu(q_feats, q_ids, q_cams, g_feats, g_ids, g_cams, g_img_paths, perm, mode='all', num_shots=1, aim=engine.aim)
AttributeError: 'Engine' object has no attribute 'aim'

@xiaoye-hhh
Copy link
Owner

Are you training or testing?

@xiaoye-hhh
Copy link
Owner

I run test.sh:
屏幕截图 2023-12-07 212803

@chenqs1995
Copy link
Author

when I am traing the epoch of 120

@xiaoye-hhh
Copy link
Owner

You can change as:
mAP, r1, r5, _, _ = eval_sysu(q_feats, q_ids, q_cams, g_feats, g_ids, g_cams, g_img_paths, perm, mode='all', num_shots=1, aim=False)

@chenqs1995
Copy link
Author

Thank you, but that's not proof that the inference phase didn't use AIM

@xiaoye-hhh
Copy link
Owner

If you want to track the inference phase, you can run test.sh with your model weight. It will execute both simple inference and AIM.

@chenqs1995
Copy link
Author

Thank you very much!

@yuting-coder
Copy link

You can change as: mAP, r1, r5, _, _ = eval_sysu(q_feats, q_ids, q_cams, g_feats, g_ids, g_cams, g_img_paths, perm, mode='all', num_shots=1, aim=False)

I encountered the following error during change this operation, how to solve it?

Epoch[1] Complete. Time taken: 00:01:00
Engine run complete. Time taken 00:01:11
Engine run is terminating due to exception: cannot reshape tensor of 0 elements into shape [0, -1] because the unspecified dimension size -1 can be any value and is ambiguous
Traceback (most recent call last):
File "D:\anaconda\envs\cumtlh\lib\site-packages\ignite\engine\engine.py", line 326, in run
self._handle_exception(e)
File "D:\anaconda\envs\cumtlh\lib\site-packages\ignite\engine\engine.py", line 291, in _handle_exception
raise e
File "D:\anaconda\envs\cumtlh\lib\site-packages\ignite\engine\engine.py", line 317, in run
self._fire_event(Events.EPOCH_COMPLETED)
File "D:\anaconda\envs\cumtlh\lib\site-packages\ignite\engine\engine.py", line 226, in fire_event
func(self, *(event_args + args), **kwargs)
File "F:\paper_code_YT\2024\01\SFE\engine_init
.py", line 150, in epoch_completed_callback
mAP, r1, r5, _, _ = eval_sysu(q_feats, q_ids, q_cams, g_feats, g_ids, g_cams, g_img_paths, perm, mode='all', num_shots=1, aim=False)
File "F:\paper_code_YT\2024\01\SFE\utils\eval_sysu.py", line 133, in eval_sysu
dist_mat = pairwise_distance(query_feats, g_feat)
File "F:\paper_code_YT\2024\01\SFE\utils\eval_sysu.py", line 15, in pairwise_distance
y = y.view(n, -1)
RuntimeError: cannot reshape tensor of 0 elements into shape [0, -1] because the unspecified dimension size -1 can be any value and is ambiguous
python-BaseException

Process finished with exit code 1

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

No branches or pull requests

3 participants