cnulab / RealNet

Offical implementation of "RealNet: A Feature Selection Network with Realistic Synthetic Anomaly for Anomaly Detection (CVPR 2024)"
MIT License
143 stars 5 forks source link

您好,根据您对于生成私有数据集异常样本的相关回复,在进行到运行sample.py时发生了关于权重导入的错误。 #38

Closed crs-syr closed 2 weeks ago

crs-syr commented 2 weeks ago

image Traceback (most recent call last): File "/opt/chenrs/RealNet-main/sample.py", line 144, in main() File "/opt/chenrs/RealNet-main/sample.py", line 68, in main model = create_diffusion_unet(**config.unet).cuda() File "/opt/chenrs/RealNet-main/models/sdas/create_models.py", line 41, in create_diffusion_unet missing_keys, unexpected_keys = load_pertrain_weights(pertrain_path,unet) File "/opt/chenrs/RealNet-main/utils/misc_helper.py", line 18, in load_pertrain_weights pertrain_state_dict = torch.load(pertrain_path, map_location=torch.device(map_location)) File "/home/jiasj/miniconda3/envs/zth2/lib/python3.8/site-packages/torch/serialization.py", line 705, in load with _open_zipfile_reader(opened_file) as opened_zipfile: File "/home/jiasj/miniconda3/envs/zth2/lib/python3.8/site-packages/torch/serialization.py", line 243, in init super(_open_zipfile_reader, self).init(torch._C.PyTorchFileReader(name_or_buffer)) RuntimeError: PytorchStreamReader failed reading zip archive: failed finding central directory

请指正如何解决,期待您的回复!

cnulab commented 2 weeks ago

你好! 你需要检查一下你的模型文件有没有损坏,应该是权重文件的问题。

crs-syr commented 2 weeks ago

已解决问题,感谢您的回复