1

I made a synthetic dataset that functions as it should with .png images and annotations in correct format <object-class> <x> <y> <width> <height>. The yolov5s.pt model is in the same folder I try to run the model from. I trained it with:

C:\Users\LeGat\AppData\Local\Programs\Python\Python311\python.exe train.py --img 300 --batch 16 --epochs 8 --data C:\Users\LeGat\Desktop\CRFOTO\data.yaml --weights yolov5s.pt

It works but the trained model uses its pre-trained weights even when I use:

model = torch.hub.load('ultralytics/yolov5', 'custom', path='runs\\train\\yolov5s.pt')
# Set the model in evaluation mode
model.eval()

I tried:

model = torch.hub.load('ultralytics/yolov5', 'custom', path='runs\\train\\exp\\weights\\best.pt', force_reload=True)
model = torch.hub.load('ultralytics/yolov5', 'custom', path='yolov5s.pt')

I tried tensorboard --logdir runs/train to see weights at "yolov5/runs/train/exp/weights" folder but this returns:

C:\Users\LeGat\yolov5\runs\train\exp\weights>tensorboard --logdir runs/train Serving TensorBoard on localhost; to expose to the network, use a proxy or pass --bind_all
TensorBoard 2.11.2 at http://localhost:6006/ (Press CTRL+C to quit)
forrtl: error (200): program aborting due to control-C event
Image              PC                Routine            Line        Source
libifcoremd.dll    00007FF90A75DF54  Unknown               Unknown  Unknown
KERNELBASE.dll     00007FF963252943  Unknown               Unknown  Unknown
KERNEL32.DLL       00007FF963DF7614  Unknown               Unknown  Unknown
ntdll.dll          00007FF9658626B1  Unknown               Unknown  Unknown
user4157124
  • 2,809
  • 13
  • 27
  • 42
  • Have a look at this answer - https://stackoverflow.com/questions/67302634/how-do-i-load-a-local-model-with-torch-hub-load. Seems like a duplicate. – Mohsin hasan Jul 16 '23 at 04:18

0 Answers0