sovit-123 / fasterrcnn-pytorch-training-pipeline

PyTorch Faster R-CNN Object Detection on Custom Dataset
MIT License
223 stars 75 forks source link

how can I bypass wandb? #47

Closed dev2y closed 1 year ago

dev2y commented 1 year ago

Wanted to train smoke and my setup went fine.. I tried the following and I am getting the following... Is there a way to skip creating W&B account?

python train.py --config data_configs/smoke.yaml --epochs 100 --model fasterrcnn_resnet50_fpn --project-name smoke_training --batch-size 16
Not using distributed mode
wandb: (1) Create a W&B account
wandb: (2) Use an existing W&B account
wandb: (3) Don't visualize my results
wandb: Enter your choice:
sovit-123 commented 1 year ago

@dev2y Type 3 and press the Enter (return) key

dev2y commented 1 year ago

Thanks.. I went ahead and created an account.. But I am now getting this error. Is this because I am trying to train using CPU but it says device cuda below?

Not using distributed mode
wandb: Currently logged in as: dev26 (dbo). Use `wandb login --relogin` to force relogin
wandb: Tracking run with wandb version 0.13.10
wandb: Run data is saved locally in /home//rcnn/fastercnn-pytorch-training-pipeline/wandb/run-20230214_000245-fgan9pge
wandb: Run `wandb offline` to turn off syncing.
wandb: Syncing run smoke_training
wandb: ⭐️ View project at https://wandb.ai/dbo/fastercnn-pytorch-training-pipeline
wandb: 🚀 View run at https://wandb.ai/dbo/fastercnn-pytorch-training-pipeline/runs/fgan9pge
device cuda
Creating data loaders
Traceback (most recent call last):
  File "/home//rcnn/fastercnn-pytorch-training-pipeline/train.py", line 532, in <module>
    main(args)
  File "/fastercnn-pytorch-training-pipeline/train.py", line 248, in main
    train_sampler = RandomSampler(train_dataset)
  File "/home/rcnn/pyenv/lib/python3.10/site-packages/torch/utils/data/sampler.py", line 107, in __init__
    raise ValueError("num_samples should be a positive integer "
ValueError: num_samples should be a positive integer value, but got num_samples=0
wandb: Waiting for W&B process to finish... (failed 1). Press Control-C to abort syncing.
wandb: 🚀 View run smoke_training at: https://wandb.ai/dbo/fastercnn-pytorch-training-pipeline/runs/fgan9pge
wandb: Synced 5 W&B file(s), 0 media file(s), 0 artifact file(s) and 0 other file(s)
wandb: Find logs at: ./wandb/run-20230214_000245-fgan9pge/logs
sovit-123 commented 1 year ago

@dev2y
Can you try the --disable-wandb with the train.py command and let me know? The above looks like a version issue.

dev2y commented 1 year ago

Hi @sovit-123, thank you. Paths to data in data_confg were incorrect.

Looks like I am good to train now. I don't have a GPU and I am trying to train with CPUs I passed -d cpu arg for train.py

python train.py --config data_configs/smoke.yaml --epochs 100 --model fasterrcnn_resnet50_fpn 
--project-name smoke_training --batch-size 5 --disable-wandb -d cpu

But I am still seeing CUDA warnings. Is this the right way to disable GPU?

sovit-123 commented 1 year ago

@dev2y CUDA warning will be there, but you won't face any errors. It will train as it should in the CPU.

dev2y commented 1 year ago

Thank you. Will close this.