-
Notifications
You must be signed in to change notification settings - Fork 19
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
TypeError: 'module' object is not callable #2
Comments
Hi, if I understand correctly you want to run this code on GPUs id 2 right? Instead of out = torch.cuda(2), can you please use CUDA_VISIBLE_DEVICES=2 and leave the code unchanged? |
thank you very much, it's very helpfulto me |
hi roysubhankar! @roysubhankar |
Please change torch.cuda(2) to torch.cuda() in your line f_cov_shrinked = (1-self.eps) * self.running_variance + self.eps * torch.eye(self.group_size, out=torch.cuda(2).FloatTensor() if torch.cuda.is_available() else torch.FloatTensor()).repeat(self.num_groups, 1, 1) An easy way to run the code is to keep the default settings and put CUDA_VISIBLE_DEVICES=2 for example if you are running your code in gpu:2 |
thank you very much,and it help me to solve this problem |
hi, thanks for your contribution
I have some problem here
Traceback (most recent call last):
File "resnet50_dwt_mec_officehome.py", line 603, in
main()
File "resnet50_dwt_mec_officehome.py", line 600, in main
target_test_loader=target_testloader)
File "resnet50_dwt_mec_officehome.py", line 420, in train_infinite_collect_stats
output = model(data)
File "/home/xing/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 489, in call
result = self.forward(*input, **kwargs)
File "resnet50_dwt_mec_officehome.py", line 336, in forward
x = torch.cat((self.bns1(x_s), torch.cat((self.bnt1(x_t), self.bnt1_aug(x_t_dup)), dim=0) ), dim=0) * self.gamma1 + self.beta1
File "/home/xing/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 489, in call
result = self.forward(*input, **kwargs)
File "resnet50_dwt_mec_officehome.py", line 60, in forward
out = self.wh(x)
File "/home/xing/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 489, in call
result = self.forward(*input, **kwargs)
File "/home/xing/mengzhu/paper_code/dwt-domain-adaptation-master/utils/whitening.py", line 50, in forward
f_cov_shrinked = (1-self.eps) * f_cov + self.eps * torch.eye(self.group_size, out=torch.cuda(2).FloatTensor() if torch.cuda.is_available() else torch.FloatTensor()).repeat(self.num_groups, 1, 1)
TypeError: 'module' object is not callable
The text was updated successfully, but these errors were encountered: