Comments (5)
@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.
π Hello there! We wanted to give you a friendly reminder that this issue has not had any recent activity and may be closed soon, but don't worry - you can always reopen it if needed. If you still have any questions or concerns, please feel free to let us know how we can help.
For additional resources and information, please see the links below:
- Docs: https://docs.ultralytics.com
- HUB: https://hub.ultralytics.com
- Community: https://community.ultralytics.com
Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed!
Thank you for your contributions to YOLO π and Vision AI β
from ultralytics.
Related Issues (20)
- Accuracy drop in ONNX and two class segmentation model HOT 9
- Triton reasoning onnx model takes category names HOT 1
- Rtsp connection error robustness handling HOT 37
- After installing the ultralytics library, GPU usage decreased by half and Ksampler time doubled HOT 3
- How to decode the keypoints output by YOLO-poseοΌ HOT 5
- Unexpected change in detection probability as image is translated HOT 2
- ultralytics masks to yolo seg convertor not working HOT 10
- Features for Individual Objects HOT 1
- customize dataset class and data loader HOT 2
- YOLO v8 doesn't use albumentations in classification task HOT 1
- labels_to_class_weights & labels_to_image_weights HOT 1
- Save the detected annotations file to the runs file HOT 1
- RTSP Stream breaks using YOLOv8 live detection HOT 9
- NotImplementedError HOT 3
- Seed setting HOT 2
- OverflowError: Python int too large to convert to C long HOT 12
- Questions regarding 'batch' and 'workers' arguments. HOT 2
- Memory leaks in your examples. HOT 4
- Non-Ascii Characters HOT 4
- False positives problemm HOT 3
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.