-
Notifications
You must be signed in to change notification settings - Fork 376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Loading record on initialized model set Option<Module>
to None
#1892
Comments
Sorry, for now, don't bother. I may have f***ed up configuration. I'm closing. If I get sure of the error, I'll reopen it. I may have tried to save some (sub)configs that were not deriving |
Reopening as it was not a configuration problem. Using the |
Probably related to #1893. |
When you get the chance, can you try your use case with the latest branch? We just merged #1902 and I think this will solve your issue. |
I'm gonna try in the next few days. Was not available last week |
Ok so I tried to make it work. Now I have a new problem. I'm trying to derive
Moreover, I cannot derive #[derive(Debug, Module, Clone)]
pub enum TensorDimension {
Chw {
channel: usize, // no field `channel` on type `&evaluator::dynamic_model::TensorDimension` unknown field [E0609]
height: usize, // Same error for all fields.
width: usize,
},
Hw {
height: usize,
width: usize,
}, // Batch-Height-Width
Flat {
length: usize,
},
} What about What about enums with struct fields? Should I change this to tuples? I prefered struct though. |
Named enum modules are not supported yet (ref #1343). Shouldn't be too difficult to extend the support based on the current derive macro for tuple enum but we haven't seen a lot of use cases for that yet. Regarding If I understand correctly though the original issue has been resolved with the PR linked in the previous comment? |
Not checked yet, it's a small refacto to use 2 different enums for modules and config |
I confirm, I get |
I need to have a Module because I need to reshape tensors and I don't have a fixed model. Model is static between trainings but is defined programmatically. So I need the info of the shape of the tensor to know if I need to make a reshape. |
Describe the bug
Records don't seem to be saved or loaded correctly with
Option<Module>
.To Reproduce
When saving model after training, the model is saved with a field that is an
Option<Module>
that is set toSome(...)
.The training config is saved as well.
Then
init
is called on the loadedTrainingConfig
.Then is the time to load the record on the initialized model with
load_record
. Weirdly, theOption<Module>
field is set toNone
.Expected behavior
When loading record, the field should be set to the saved
Some(...)
.Desktop (please complete the following information):
Additional context
The text was updated successfully, but these errors were encountered: