HRNet-Semantic-Segmentation icon indicating copy to clipboard operation
HRNet-Semantic-Segmentation copied to clipboard

how to solve this problem ?Traceback (most recent call last): File "tools/train.py", line 287, in <module> main() File "tools/train.py", line 229, in main model.module.load_state_dict(checkpoint['state_dict']) File "/home/wrc/anaconda3/envs/HRNet/lib/python3.6/site-packages/torch/nn/modules/module.py", line 539, in __getattr__ type(self).__name__, name)) AttributeError: 'FullModel' object has no attribute 'module'

Open sunny0414 opened this issue 4 years ago • 9 comments

sunny0414 avatar Jun 23 '20 14:06 sunny0414

have you solved the problem? I met the same trouble

wuwulin avatar Sep 24 '20 01:09 wuwulin

have you solved the problem? I met the same trouble

carlsummer avatar Apr 02 '21 01:04 carlsummer

maybe conda install pytorch torchvision cudatoolkit=10.2 -c pytorch

carlsummer avatar Apr 02 '21 01:04 carlsummer

def is_parallel(model): return type(model) in (nn.parallel.DataParallel, nn.parallel.DistributedDataParallel) msd = model.module.state_dict() if is_parallel(model) else model.state_dict() # model state_dict

carlsummer avatar Apr 02 '21 01:04 carlsummer

python -m torch.distributed.launch --nproc_per_node=2 tools/train.py

carlsummer avatar Apr 02 '21 02:04 carlsummer

它是多卡默认,但是你是单卡在跑,所以报错了 It is multi-card default, but you are running with a single card, so an error is reported

carlsummer avatar Apr 02 '21 02:04 carlsummer

它是多卡默认,但是你是单卡在跑,所以报错了 It is multi-card default, but you are running with a single card, so an error is reported

大佬,我只有一张卡,要怎么修改知道吗

Robinxin123 avatar Mar 25 '22 11:03 Robinxin123

have you solved the problem? I met the same trouble

have you solved the problem?

Robinxin123 avatar Mar 25 '22 12:03 Robinxin123

所以说应该怎么改成单卡呢

stu-xsy avatar Mar 26 '22 06:03 stu-xsy