WangRongsheng / BestYOLO

🌟Change the world, it will become a better place. | 以科研和竞赛为导向的最好的YOLO实践框架!
GNU General Public License v3.0
221 stars 34 forks source link

AttributeError: 'EfficientNet' object has no attribute 'yaml' #6

Closed onur-unsoy closed 8 months ago

onur-unsoy commented 10 months ago

@WangRongsheng 你好, I used to your repo and i want to perform a training using my own dataset. I want to use efficientNet instead of darknet in my backbone network. Within the train.py file, I replaced my weights with efficientnet_b0.pt instead of yolov5n.pt. The error mentioned in the title appears. I would be happy if you

runfile('D:/BestYOLO/BestYOLO-main/train.py', wdir='D:/BestYOLO/BestYOLO-main') Reloaded modules: models, utils, utils.downloads, utils.metrics, utils.general, utils.augmentations, utils.torch_utils, utils.dataloaders, utils.segment, utils.segment.general, utils.plots, models.common, classify.val, models.experimental, utils.autoanchor, models.yolo, utils.loggers.clearml, utils.loggers.clearml.clearml_utils, utils.loggers.wandb, utils.loggers.wandb.wandb_utils, utils.loggers train: weights=efficientnet_b0.pt, cfg=, data=data\coco128.yaml, hyp=data\hyps\hyp.scratch-low.yaml, epochs=2, batch_size=2, imgsz=640, rect=False, resume=False, nosave=False, noval=False, noautoanchor=False, noplots=False, evolve=None, bucket=, cache=None, image_weights=False, device=, multi_scale=False, single_cls=False, optimizer=SGD, sync_bn=False, workers=8, project=runs\train, name=exp, exist_ok=False, quad=False, cos_lr=False, label_smoothing=0.0, patience=100, freeze=[0], save_period=-1, seed=3407, local_rank=-1, loss_OTA=False, entity=None, upload_dataset=False, bbox_interval=-1, artifact_alias=latest YOLOv5 2023-10-30 Python-3.10.13 torch-2.1.0+cpu CPU

hyperparameters: lr0=0.01, lrf=0.01, momentum=0.937, weight_decay=0.0005, warmup_epochs=3.0, warmup_momentum=0.8, warmup_bias_lr=0.1, box=0.05, cls=0.5, cls_pw=1.0, obj=1.0, obj_pw=1.0, iou_t=0.2, anchor_t=4.0, fl_gamma=0.0, hsv_h=0.015, hsv_s=0.7, hsv_v=0.4, degrees=0.0, translate=0.1, scale=0.5, shear=0.0, perspective=0.0, flipud=0.0, fliplr=0.5, mosaic=1.0, mixup=0.0, copy_paste=0.0 ClearML: run 'pip install clearml' to automatically track, visualize and remotely train YOLOv5 in ClearML Comet: run 'pip install comet_ml' to automatically track and visualize YOLOv5 runs in Comet TensorBoard: Start with 'tensorboard --logdir runs\train', view at http://localhost:6006/ github: skipping check (not a git repository), for updates see https://github.com/ultralytics/yolov5 Traceback (most recent call last):

File ~.conda\envs\thesis_two\lib\site-packages\spyder_kernels\py3compat.py:356 in compat_exec exec(code, globals, locals)

File d:\bestyolo\bestyolo-main\train.py:640 main(opt)

File d:\bestyolo\bestyolo-main\train.py:534 in main train(opt.hyp, opt, device, callbacks)

File d:\bestyolo\bestyolo-main\train.py:125 in train model = Model(cfg or ckpt['model'].yaml, ch=3, nc=nc, anchors=hyp.get('anchors')).to(device) # create

File ~.conda\envs\thesis_two\lib\site-packages\torch\nn\modules\module.py:1695 in getattr raise AttributeError(f"'{type(self).name}' object has no attribute '{name}'")

AttributeError: 'EfficientNet' object has no attribute 'yaml'

onur-unsoy commented 8 months ago

谢谢您。

On Wed, Jan 10, 2024, 14:46 WangRongsheng @.***> wrote:

Closed #6 https://github.com/WangRongsheng/BestYOLO/issues/6 as completed.

— Reply to this email directly, view it on GitHub https://github.com/WangRongsheng/BestYOLO/issues/6#event-11442177777, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVPXL2JCTW3VKGDMQPHULY3YNZ5Q7AVCNFSM6AAAAAA7L5WL26VHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJRGQ2DEMJXG43TONY . You are receiving this because you authored the thread.Message ID: @.***>