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

Code error #102

Open
lzjjia opened this issue Jan 16, 2025 · 3 comments
Open

Code error #102

lzjjia opened this issue Jan 16, 2025 · 3 comments

Comments

@lzjjia
Copy link

lzjjia commented Jan 16, 2025

Hi, I followed the steps you gave to run the code, but an error was reported in line 632(feat_fc_video_source = feat_fc_source.view((-1, num_segments) + feat_fc_source.size()[-1:])) of the models.py file.
the error as follows:
Traceback (most recent call last): File "/data/lizhijia/python_project/TA3N-master/main.py", line 835, in <module> main() File "/data/lizhijia/python_project/TA3N-master/main.py", line 252, in main prec1 = validate(val_loader, model, criterion, num_class, epoch, val_file) File "/data/lizhijia/python_project/TA3N-master/main.py", line 707, in validate _, _, _, _, _, attn_val, out_val, out_val_2, pred_domain_val, feat_val = model(val_data, val_data, [0]*len(args.beta), 0, is_train=False, reverse=False) File "/home/lizhijia/anaconda3/envs/Hyrsm++/lib/python3.7/site-packages/torch/nn/modules/module.py", line 889, in _call_impl result = self.forward(*input, **kwargs) File "/home/lizhijia/anaconda3/envs/Hyrsm++/lib/python3.7/site-packages/torch/nn/parallel/data_parallel.py", line 165, in forward return self.module(*inputs[0], **kwargs[0]) File "/home/lizhijia/anaconda3/envs/Hyrsm++/lib/python3.7/site-packages/torch/nn/modules/module.py", line 889, in _call_impl result = self.forward(*input, **kwargs) File "/data/lizhijia/python_project/TA3N-master/models.py", line 632, in forward feat_fc_video_source = feat_fc_source.view((-1, num_segments) + feat_fc_source.size()[-1:]) # reshape based on the segments (e.g. 640x512 --> 128x5x512) RuntimeError: only one dimension can be inferred

@lzjjia
Copy link
Author

lzjjia commented Jan 16, 2025

I noticed that when training to train[1][0/1], the parameters in the viem method became (-1,-1,512), so I fixed the parameters in the view method directly to (-1,5,512), and then the code can run. But the training result is:
Best score 33.33333206176758 vs current score 12.962963104248047
Is this result correct?

@lzjjia
Copy link
Author

lzjjia commented Jan 16, 2025

The source domain I used is UCF101 and the target domain is olympic

@lzjjia
Copy link
Author

lzjjia commented Jan 16, 2025

one more question: You divide the dataset into a validation set and a training set. When I test the model, should I use the validation set of the target domain?

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

1 participant