Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: module 'wandb' has no attribute 'run' #1958

Closed
HypnosWei opened this issue Jan 16, 2021 · 10 comments
Closed

AttributeError: module 'wandb' has no attribute 'run' #1958

HypnosWei opened this issue Jan 16, 2021 · 10 comments
Labels
question Further information is requested

Comments

@HypnosWei
Copy link

HypnosWei commented Jan 16, 2021

❔Question

When I use ipython, I just run this
[run train.py --epochs 2 --batch-size 32 --data ./data/train.yaml --weights ./runs/train/exp5/weights/best.pt --cfg ./models/yolov5s.yaml ]

I already create new environment ,but it doesn't work.
I also download the whole yolov5 files again, but it doesn't work too.

but the command window show that

Additional context

[
bug

@HypnosWei HypnosWei added the question Further information is requested label Jan 16, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Jan 16, 2021

👋 Hello @HypnosWei, thank you for your interest in 🚀 YOLOv5! Please visit our ⭐️ Tutorials to get started, where you can find quickstart guides for simple tasks like Custom Data Training all the way to advanced concepts like Hyperparameter Evolution.

If this is a 🐛 Bug Report, please provide screenshots and minimum viable code to reproduce your issue, otherwise we can not help you.

If this is a custom training ❓ Question, please provide as much information as possible, including dataset images, training logs, screenshots, and a public link to online W&B logging if available.

For business inquiries or professional support requests please visit https://www.ultralytics.com or email Glenn Jocher at [email protected].

Requirements

Python 3.8 or later with all requirements.txt dependencies installed, including torch>=1.7. To install run:

$ pip install -r requirements.txt

Environments

YOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):

Status

CI CPU testing

If this badge is green, all YOLOv5 GitHub Actions Continuous Integration (CI) tests are currently passing. CI tests verify correct operation of YOLOv5 training (train.py), testing (test.py), inference (detect.py) and export (export.py) on MacOS, Windows, and Ubuntu every 24 hours and on every commit.

@glenn-jocher
Copy link
Member

@HypnosWei you code may be out of date. Is this reproducible with current master? If so please submit a colab notebook we can us to reproduce and debug. Thank you!

@HypnosWei
Copy link
Author

I try to pip install wanb and it work ,the code keep update ? It is very awesome!
I am a student and try to finish the final project about object detect, but the best mAP of our training model is just 0.458 . I want to try the data augmentation , but find the hyp.scratch.yaml has flip and some of trick, so I don't know how can improve the result . if you have some better recommendation ,I will very thank you!!

end

sorry about my pool english .

@glenn-jocher
Copy link
Member

@HypnosWei great, so everything is working correctly now?

For training tips you may want to upload your results. If this is a custom training ❓ Question, please provide as much information as possible, including dataset images, training logs, screenshots, and a public link to online W&B logging if available.

@github-actions
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the Stale Stale and schedule for closing soon label Feb 17, 2021
@mattpopovich
Copy link

Just to clarify for anyone else with this issue, you get it probably because you do not have wandb installed. Installing it via pip install wandb fixed the issue for me!

@glenn-jocher
Copy link
Member

@mattpopovich @AyushExel this is likely due to wandb creating a wandb directory, which is then not differentiable from a package import. I've raised this issue with W&B before.

@AyushExel
Copy link
Contributor

@glenn-jocher this can be solved if we include the library components in check

    try:
        import wandb
        from wandb import init, log, join  # test that these are available
    except ImportError:
       print("msg")

@AyushExel AyushExel mentioned this issue Mar 23, 2021
@glenn-jocher
Copy link
Member

Update: This may be fixed now in PR # 2574.

@glenn-jocher glenn-jocher removed the Stale Stale and schedule for closing soon label Mar 23, 2021
@mattpopovich
Copy link

mattpopovich commented Mar 23, 2021

Looks good to me. As expected, now gives a notice to install wandb if it's not already installed and no longer crashes before training.

github: skipping check (Docker image)                                                                                                                                            
YOLOv5 🚀 v4.0-142-g1bf9365 torch 1.8.0a0+52ea372 CUDA:2 (GeForce GTX 1080, 8119.5625MB)                                                                                         
                                                                                                                                                                                 
Namespace(adam=False, artifact_alias='latest', batch_size=16, bbox_interval=-1, bucket='', cache_images=False, cfg='', data='./data/coco128.yaml', device='2', entity=None, epoch
s=5, evolve=False, exist_ok=False, global_rank=-1, hyp='data/hyp.scratch.yaml', image_weights=False, img_size=[640, 640], linear_lr=False, local_rank=-1, multi_scale=False, name
='test', noautoanchor=False, nosave=False, notest=False, project='runs/train', quad=False, rect=False, resume=False, save_dir='runs/train/test8', save_period=-1, single_cls=Fals
e, sync_bn=False, total_batch_size=16, upload_dataset=False, weights='yolov5s.pt', workers=8, world_size=1)                                                                      
Start Tensorboard with "tensorboard --logdir runs/train", view at http://localhost:6006/                                                                                         
hyperparameters: lr0=0.01, lrf=0.2, 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, mosa
ic=1.0, mixup=0.0                                                                                                                                                                
wandb: Install Weights & Biases for YOLOv5 logging with 'pip install wandb' (recommended)                                                                                        
                                                                                                                                                                                 
                 from  n    params  module                                  arguments                                                                                            
  0                -1  1      3520  models.common.Focus                     [3, 32, 3]                                                                                           
  1                -1  1     18560  models.common.Conv                      [32, 64, 3, 2]        

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants