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

Error Processing OOD Data with “config.transforme_test_largescale” in data_loader.py #11

Open
howell0203 opened this issue Aug 7, 2023 · 0 comments

Comments

@howell0203
Copy link

howell0203 commented Aug 7, 2023

This error occurs when attempting to process out-of-distribution (OOD) data (specifically, the iNaturalist dataset you provided) using the config.transforme_test_largescale in the data_loader.py file,showed in below. However, when the config.transform_test is utilized, the processing is successful.

 val_ood_loader = torch.utils.data.DataLoader(
                torchvision.datasets.ImageFolder("./datasets/ood_data/iNaturalist".format(val_dataset),
                                                 transform=config.transform_test_largescale), batch_size=batch_size, shuffle=False,
                num_workers=2)

Processing out-of-distribution images

Traceback (most recent call last):
File "E:\ReAct\react-master\eval.py", line 169, in
eval_ood_detector(args, mode_args)
File "E:\ReAct\react-master\eval.py", line 121, in eval_ood_detector
logits = forward_threshold(inputs, model)
File "E:\ReAct\react-master\eval.py", line 22, in forward_threshold
logits = model.forward_threshold(inputs, threshold=args.threshold)
File "E:\ReAct\react-master\models\resnet.py", line 410, in forward_threshold
return self.fc(x)
File "E:\Anaconda\envs\ReAct\lib\site-packages\torch\nn\modules\module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "E:\Anaconda\envs\ReAct\lib\site-packages\torch\nn\modules\linear.py", line 93, in forward
return F.linear(input, self.weight, self.bias)
File "E:\Anaconda\envs\ReAct\lib\site-packages\torch\nn\functional.py", line 1690, in linear
ret = torch.addmm(bias, input, weight.t())
RuntimeError: mat1 dim 1 must match mat2 dim 0

Process finished with exit code 1

@howell0203 howell0203 changed the title RuntimeError: mat1 dim 1 must match mat2 dim 0 Error Processing OOD Data with “config.transforme_test_largescale” in data_loader.py Aug 7, 2023
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