Zj-BinXia / DiffIR

This project is the official implementation of 'Diffir: Efficient diffusion model for image restoration', ICCV2023
Apache License 2.0
472 stars 20 forks source link

单卡训练报错 #36

Open zdyshine opened 10 months ago

zdyshine commented 10 months ago

Traceback (most recent call last): File "DiffIR/train.py", line 15, in train_pipeline(root_path) File "/DiffIR/DiffIR-RealSR/DiffIR/train_pipeline.py", line 185, in train_pipeline model.optimize_parameters(current_iter) File "/DiffIR/DiffIR-RealSR/DiffIR/models/DiffIR_S2_model.py", line 408, in optimizeparameters , pred_IPR_list = self.net_g.module.diffusion(self.lq,S1_IPR[0]) File "/opt/conda/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1207, in getattr raise AttributeError("'{}' object has no attribute '{}'".format( AttributeError: 'DiffIRS2' object has no attribute 'module'

多卡训练时会有module这个属性,是必须使用多卡训练吗?

Zj-BinXia commented 10 months ago

You can change _, pred_IPR_list = self.net_g.module.diffusion(self.lq,S1IPR[0]) to , pred_IPR_list = self.net_g.diffusion(self.lq,S1_IPR[0])