HuiZhang0812 / DiffusionAD

148 stars 16 forks source link

Error when running python train.py #19

Closed mcw1217 closed 9 months ago

mcw1217 commented 10 months ago

hello. I've read your paper. I'm not good at writing code and have little experience with experiments, so I get an error when running python train.py.

I downloaded the suggested dataset mvtec dataset and saved it as a folder named mvtec in the data folder. After that, I went to Google Drive, downloaded the foreground file, and pasted it into the mvtec file. Afterwards, when you specify the DTD path and run python train.py, the following error message occurs. (Does not apply to visA dataset)

Since my skills are limited, I would really appreciate it if you could explain.

image

Below is the path and file status of the dataset I set. image

HuiZhang0812 commented 10 months ago

Hello, I have double-checked the code, and I did not encounter such an issue. This looks like an issue with the dataset path, maybe you can download the source code again and give it another try. Additionally, you can output the paths for each sub-class to confirm whether the paths are set correctly

mcw1217 commented 10 months ago

image I added a new code and dataset again, and confirmed that the train dataset of the mvtec dataset was 280. After that, that error occurs.

mcw1217 commented 10 months ago

image

When I printed n_head_channels, I got a str string with no value.

Result: ' ' -> str So an error occurred in in_channels % n_head_channels == 0.

Action: By arbitrarily specifying the value n_head_channels=-1, learning became possible.

Would there be any problem if I took action in this way?

HuiZhang0812 commented 10 months ago

I haven't encountered such an issue before, and the value of 'num_head_channels' is set to -1 by default in args1.json.