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)
- train a model with a new label HOT 4
- running bug on amd HOT 11
- About weight file HOT 3
- camera resolution for real time detection HOT 1
- The GPU utilization is limited when infering diffusion models with lora weights HOT 2
- segment result HOT 2
- bug to PyTorch. HOT 1
- Transfer weights from yolov8l-seg.pt to a new architecture HOT 3
- Accuracy Plot HOT 1
- Batch Size per GPU options HOT 1
- choose specific set of classes for training in COCO dataset HOT 1
- Handling Occluded Objects HOT 11
- Training YOLOv8 problem HOT 2
- YOLOv8 segmentation head, loss, and confidence score HOT 4
- Predications from my model that aren't in my dataset. Am I using the wrong methods to test my model? HOT 6
- Setting width of bouding box HOT 2
- How much data to pass for YOLO if we have the same object in our dataset we want to detect HOT 1
- Yolov8 obb training label bbox show wrong HOT 3
- How to use onnx classify model at C++ HOT 3
- # TODO CoreML Segment and Pose model pipelining HOT 9
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.