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

'Module not Callable' #2

Open
EyuT777 opened this issue Sep 13, 2021 · 1 comment
Open

'Module not Callable' #2

EyuT777 opened this issue Sep 13, 2021 · 1 comment

Comments

@EyuT777
Copy link

EyuT777 commented Sep 13, 2021

I was working on the algorithm, running all the parameters as required. This is the output shown. Can you please help with it?

C:\Users\User\Desktop\Home>python C:\Users\User\Desktop\Home>python C:\Users\User\Desktop\Home\ACRNet\main.py --data-dir C:\Users\User\Desktop\Home\COST2100 --reduction 4 --expansion 1 --batch-size 200 --scenario in --workers 0
I 09.13/12:19 C:\Users\User\Desktop\Home\ACRNet\main.py:35 ] => PyTorch Version: 1.9.0+cpu
I 09.13/12:19 C:\Users\User\Desktop\Home\ACRNet\main.py:14 ] Running on CPU
I 09.13/12:20 C:\Users\User\Desktop\Home\ACRNet\model\acrnet.py:117 ] => Model ACRNet with reduction=4, expansion=1
I 09.13/12:20 C:\Users\User\Desktop\Home\ACRNet\main.py:24 ] => Model Name: ACRNet
I 09.13/12:20 C:\Users\User\Desktop\Home\ACRNet\main.py:24 ] => Model Config: compression ratio=1/4; expansion=1
I 09.13/12:20 C:\Users\User\Desktop\Home\ACRNet\main.py:24 ]


ACRNet(
(encoder_feature): Sequential(
(conv5x5_bn): ConvBN(
(conv): Conv2d(2, 2, kernel_size=(5, 5), stride=(1, 1), padding=(2, 2), bias=False)
(bn): BatchNorm2d(2, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
)
(prelu): PReLU(num_parameters=2)
(ACREncoderBlock1): ACREncoderBlock(
(conv_bn1): ConvBN(
(conv): Conv2d(2, 2, kernel_size=(1, 9), stride=(1, 1), padding=(0, 4), bias=False)
(bn): BatchNorm2d(2, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
)
(prelu1): PReLU(num_parameters=2)
(conv_bn2): ConvBN(
(conv): Conv2d(2, 2, kernel_size=(9, 1), stride=(1, 1), padding=(4, 0), bias=False)
(bn): BatchNorm2d(2, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
)
(prelu2): PReLU(num_parameters=2)
(identity): Identity()
)
(ACREncoderBlock2): ACREncoderBlock(
(conv_bn1): ConvBN(
(conv): Conv2d(2, 2, kernel_size=(1, 9), stride=(1, 1), padding=(0, 4), bias=False)
(bn): BatchNorm2d(2, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
)
(prelu1): PReLU(num_parameters=2)
(conv_bn2): ConvBN(
(conv): Conv2d(2, 2, kernel_size=(9, 1), stride=(1, 1), padding=(4, 0), bias=False)
(bn): BatchNorm2d(2, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
)
(prelu2): PReLU(num_parameters=2)
(identity): Identity()
)
)
(encoder_fc): Linear(in_features=2048, out_features=512, bias=True)
(decoder_fc): Linear(in_features=512, out_features=2048, bias=True)
(decoder_feature): Sequential(
(conv5x5_bn): ConvBN(
(conv): Conv2d(2, 2, kernel_size=(5, 5), stride=(1, 1), padding=(2, 2), bias=False)
(bn): BatchNorm2d(2, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
)
(prelu): PReLU(num_parameters=2)
(ACRDecoderBlock1): ACRDecoderBlock(
(conv1_bn): ConvBN(
(conv): Conv2d(2, 8, kernel_size=(1, 9), stride=(1, 1), padding=(0, 4), bias=False)
(bn): BatchNorm2d(8, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
)
(prelu1): PReLU(num_parameters=8)
(conv2_bn): ConvBN(
(conv): Conv2d(8, 8, kernel_size=(7, 7), stride=(1, 1), padding=(3, 3), groups=4, bias=False)
(bn): BatchNorm2d(8, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
)
(prelu2): PReLU(num_parameters=8)
(conv3_bn): ConvBN(
(conv): Conv2d(8, 2, kernel_size=(9, 1), stride=(1, 1), padding=(4, 0), bias=False)
(bn): BatchNorm2d(2, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
)
(prelu3): PReLU(num_parameters=2)
(identity): Identity()
)
(ACRDecoderBlock2): ACRDecoderBlock(
(conv1_bn): ConvBN(
(conv): Conv2d(2, 8, kernel_size=(1, 9), stride=(1, 1), padding=(0, 4), bias=False)
(bn): BatchNorm2d(8, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
)
(prelu1): PReLU(num_parameters=8)
(conv2_bn): ConvBN(
(conv): Conv2d(8, 8, kernel_size=(7, 7), stride=(1, 1), padding=(3, 3), groups=4, bias=False)
(bn): BatchNorm2d(8, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
)
(prelu2): PReLU(num_parameters=8)
(conv3_bn): ConvBN(
(conv): Conv2d(8, 2, kernel_size=(9, 1), stride=(1, 1), padding=(4, 0), bias=False)
(bn): BatchNorm2d(2, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
)
(prelu3): PReLU(num_parameters=2)
(identity): Identity()
)
(sigmoid): Sigmoid()
)
)


Traceback (most recent call last):
File "C:\Users\User\Desktop\Home\ACRNet\main.py", line 35, in
main()
File "C:\Users\User\Desktop\Home\ACRNet\main.py", line 31, in main
Tester(model, device, criterion, print_freq=20)(test_loader)
File "C:\Users\User\Desktop\Home\ACRNet\utils\solver.py", line 35, in call
loss, rho, nmse = self._iteration(test_data)
File "C:\Users\User\Desktop\Home\ACRNet\utils\solver.py", line 56, in _iteration
rho, nmse = evaluator(sparse_pred, sparse_gt, raw_gt)
File "C:\Users\User\Desktop\Home\ACRNet\utils\statics.py", line 60, in evaluator
raw_pred = torch.fft(sparse_pred, signal_ndim=1)[:, :, :125, :]
TypeError: 'module' object is not callable

@shubhamsrivast4u
Copy link

The following adjustment solved this error at my end. use

raw_pred = torch.fft.fft(sparse_pred, dim=1)[:, :, :125, :]

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

2 participants