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

where is .yaml file? #1

Open
AaddX-ai opened this issue Dec 19, 2024 · 3 comments
Open

where is .yaml file? #1

AaddX-ai opened this issue Dec 19, 2024 · 3 comments

Comments

@AaddX-ai
Copy link

I cannot find the yaml when I run the gen the template:
python run.py --mode test --ttype ALL --dataset /mnt/sunxiaogang/RealNet/data/MVTec-AD/mvtec
/mnt/sunxiaogang/miniconda3/envs/hetmm/lib/python3.9/site-packages/torch/utils/cpp_extension.py:1964: UserWarning: TORCH_CUDA_ARCH_LIST is not set, all archs for visible cards are included for compilation.
If this is not desired, please set os.environ['TORCH_CUDA_ARCH_LIST'].
warnings.warn(
Traceback (most recent call last):
File "/mnt/sunxiaogang/HETMM/run.py", line 80, in
cfg = Cfg(args)
File "/mnt/sunxiaogang/HETMM/src/config.py", line 19, in init
with open(os.path.join('configs', f'{args.dataset}.yaml'), 'r') as dfile:
FileNotFoundError: [Errno 2] No such file or directory: '/mnt/sunxiaogang/RealNet/data/MVTec-AD/mvtec.yaml'

@NarcissusEx
Copy link
Owner

Hello, thanks for your attentions. The previous version needs to replace the datapath in the "configs/MVTec_AD.yaml" file and then run the command: python run.py --mode test --ttype ALL --dataset MVTec_AD, which is so inconvenient for evaluation. Thus, we optimize the implementation and add an argument "--datapath" in "run.py". Please update the code and see the scripts in "run.sh" file in details.


@AaddX-ai
Copy link
Author

thank u for your patience! but I get one new error:
python run.py --mode test --ttype PTS --tsize 60 --dataset MVTec_AD --datapath=/mnt/sunxiaogang/RealNet/data/MVTec-AD/mvtec
/mnt/sunxiaogang/miniconda3/envs/hetmm/lib/python3.9/site-packages/torch/utils/cpp_extension.py:1964: UserWarning: TORCH_CUDA_ARCH_LIST is not set, all archs for visible cards are included for compilation.
If this is not desired, please set os.environ['TORCH_CUDA_ARCH_LIST'].
warnings.warn(
carpet: 0%| | 0/1 [00:00<?, ?it/s]/mnt/sunxiaogang/miniconda3/envs/hetmm/lib/python3.9/site-packages/torch/functional.py:534: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at /opt/conda/conda-bld/pytorch_1729647350383/work/aten/src/ATen/native/TensorShape.cpp:3595.)
return _VF.meshgrid(tensors, **kwargs) # type: ignore[attr-defined]
carpet: 0%| | 0/1 [00:01<?, ?it/s]
Traceback (most recent call last):
File "/mnt/sunxiaogang/HETMM/run.py", line 84, in
globals()args.mode
File "/mnt/sunxiaogang/HETMM/run.py", line 37, in test
score = cfg.model.impl(query, cfg.temp)
File "/mnt/sunxiaogang/HETMM/src/models/atmm.py", line 105, in impl
fores = self.match(super().impl(querys, temps, self.fore_patches), self.fore_patches, forward_ATM)
File "/mnt/sunxiaogang/HETMM/src/models/atmm.py", line 79, in match
return [self.upsample(1 - func(q, t, r).amax(dim=1).reshape(q.shape[0], 1, *q.shape[-2:])) for (q, t), r in zip(feas, patches)]
File "/mnt/sunxiaogang/HETMM/src/models/atmm.py", line 79, in
return [self.upsample(1 - func(q, t, r).amax(dim=1).reshape(q.shape[0], 1, *q.shape[-2:])) for (q, t), r in zip(feas, patches)]
IndexError: Dimension out of range (expected to be in range of [-3, 2], but got 3)

@NarcissusEx
Copy link
Owner

I have never seen this bug before. The code in my machine works well. I guess the problem may be caused by the invalid/unexpected dimension of input features, i.e., q and t. You can print their shape to locate the reason.

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