toandaominh1997 / EfficientDet.Pytorch

Implementation EfficientDet: Scalable and Efficient Object Detection in PyTorch
MIT License
1.44k stars 306 forks source link

AttributeError: 'EfficientDet' object has no attribute 'module' #94

Open wangtianlong1994 opened 4 years ago

wangtianlong1994 commented 4 years ago

Please help me. Model not found after start of training This problem occurs when I specify GPU。 Setting the GPU configuration to none will not cause this problem, but will the training use GPU?

Here is the error message

(effdet) zxzn@zxzn:~/EfficientDet.Pytorch$ python3 train.py --network efficientdet-d4 /home/zxzn/EfficientDet.Pytorch/datasets/VOCdevkit/ train.py:302: UserWarning: You have chosen to seed training. This will turn on the CUDNN deterministic setting, which can slow down your training considerably! You may see unexpected behavior when restarting from checkpoints. warnings.warn('You have chosen to seed training. ' train.py:309: UserWarning: You have chosen a specific GPU. This will completely disable data parallelism. warnings.warn('You have chosen a specific GPU. This will completely ' Use GPU: 0 for training Downloading: "http://storage.googleapis.com/public-models/efficientnet/efficientnet-b4-6ed6700e.pth" to /home/zxzn/.cache/torch/checkpoints/efficientnet-b4-6ed6700e.pth 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 74.4M/74.4M [00:32<00:00, 2.43MB/s] Loaded pretrained weights for efficientnet-b4 0 epoch: start training.... Traceback (most recent call last): File "train.py", line 333, in main() File "train.py", line 329, in main main_worker(args.gpu, ngpus_per_node, args) File "train.py", line 274, in main_worker train(train_loader, model, scheduler, optimizer, epoch, args) File "train.py", line 101, in train model.module.is_training = True File "/home/zxzn/.conda/envs/effdet/lib/python3.7/site-packages/torch/nn/modules/module.py", line 585, in getattr type(self).name, name)) AttributeError: 'EfficientDet' object has no attribute 'module'

yangyin2016 commented 4 years ago

hi,I meet the same problem,have you solved this problem

wangtianlong1994 commented 4 years ago

嗨,我遇到了同样的问题,你解决了这个问题吗

train.py --gpu Set up None

apekshapriya commented 4 years ago

Hi, I met the same error, I solved it by replacing "model.module.is_training = True" to "model.is_training=True"

wangtianlong1994 commented 4 years ago

您好,我遇到了同样的错误,我解决它通过更换 “model.module.is_training =真” 到 “model.is_training =真”

Thank you. This can solve this problem and specify the Gpu training