Comments (4)
@glenn-jocher I came up with a solution,
Only the pure model parameters are saved in version 8.1.106, and then the pure model parameters are obtained under 8.1.44.
from ultralytics.
Hi there! It seems like the issue might be related to incompatible versions between the one used to save the model (ultralytics==8.1.106) and the one you're trying to load it with (ultralytics==8.1.44). You might be able to resolve this error by ensuring both the saving and loading are performed with the same version of the library. If you cannot run the same older version, consider upgrading your current environment to match the version used for saving the model. Hereβs how you can upgrade the library:
pip install ultralytics==8.1.106
Just make sure that the version number matches exactly to the one used for saving the model weights. Let me know if this helps or if you encounter any other issues! π
from ultralytics.
I am aware that the upgrade to 8.1.106 is capable of reading this weight, but I would like to read this weight under 8.1.44 for retraining.
from ultralytics.
@tongchangD hi there! That sounds like a great approach! By saving only the model parameters in version 8.1.106 and then loading them in version 8.1.44, you should be able to bypass the module compatibility issues. Here's a quick example of how you can do this:
Saving model parameters in 8.1.106
# Assuming 'model' is your trained model
torch.save(model.state_dict(), 'model_weights.pth')
Loading model parameters in 8.1.44
# Make sure to initialize the model architecture similarly as it was in 8.1.106
model.load_state_dict(torch.load('model_weights.pth', map_location=torch.device('cpu')))
model.eval()
This method ensures that you're only dealing with the raw weights and biases, independent of any specific module structure that might have changed between versions. Let me know if this works for you! π
from ultralytics.
Related Issues (20)
- Yolov9 pytorch model is empty, as in not the folder, the loaded pytorch model. HOT 1
- Model exported to CoreML showing 1.0 confidence values for all detections HOT 4
- YOLOv8-OBB learns 0Β° rotation HOT 12
- train with arg use_ray=True, raise exception OSError: [WinError 87], at _winapi.CreateProcess HOT 3
- New network structure with old weights HOT 3
- For increasing or decreasing video streams,Is there a better way to detect the need to interrupt and then load new data and restart? HOT 1
- Is YOLOv8 Using Val Set to train? HOT 2
- Can YOLOv8 Simultaneously Support Rotated Object Detection (OBB) and Keypoint Detection? HOT 3
- yolov8 when train,raise error OSError: [WinError 87] parameters error HOT 1
- Will you support YOLOv10 in the future? HOT 2
- YOLOv8 OBB HOT 1
- YOLOv8 with KAN HOT 2
- A question about validation set drawing image results HOT 2
- Determine the Class of a Specific Pixel-Coordinate from YOLOv8 Segmentation Results HOT 2
- Custom train for table structure HOT 4
- Please change this misleading tip HOT 2
- Tracking with 1 model and N multi-stream HOT 9
- edgetpu.ftlite is numpy.int8 but Coral only support uint8 input type HOT 1
- Getting error while Converting to tensorRT HOT 5
- Unable to Export RTDETR Large Model(best.pt) to TFLite or NCNN for Raspberry Pi 4 Deployment HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ultralytics.