HuiZhang0812 / DiffusionAD

148 stars 16 forks source link

When I try to run python train.py 1,encountered a problem #14

Closed yaoyaoyao13 closed 10 months ago

yaoyaoyao13 commented 10 months ago

RuntimeError: random_ expects 'from' to be less than 'to', but got from=0 >= to=0 how to solve this problem?

HuiZhang0812 commented 10 months ago

I haven't encountered this problem before. Could you provide more detailed error information?

yaoyaoyao13 commented 10 months ago

I only modified the mvtec in the args1.json file Root Path, arbitrarily Source Path and output_ Path, and Foreground was added to the mvtec dataset based on the data tree

068a725151c6038689e37662e597d56
HuiZhang0812 commented 10 months ago

The anomaly source path refers to the Describable Textures dataset. Please download it and then modify the anomaly source path.

yaoyaoyao13 commented 10 months ago

Thank you for your reply. I think I have modified the code according to your requirements, but it is not

400f2455addaa4c702486d68938f9bd
HuiZhang0812 commented 10 months ago

We only use the "images" folder within the DTD directory. I have updated the source code for convenience and you can re-download it.​

yaoyaoyao13 commented 10 months ago

Thank you, my problem has been resolved

02lenny commented 4 months ago

Hello! @yaoyaoyao13

May I ask what did you do to solve the problem? I am also encountering this problem and this is my path to the DTD /content/drive/MyDrive/DiffusionDA/DiffusionAD-main/datasets/DTD

and the folders inside this are the folders from images, here is an example: /content/drive/MyDrive/DiffusionDA/DiffusionAD-main/datasets/DTD/banded

thank you so much for answering as I am trying to implement this research for school.