For training, I use the libtorch CUDA 10.1 package as it’s way faster than training on the CPU.
For deployment, I want to use the libtorch No CUDA (CPU only) package as it’s lighter and I don’t need GPU acceleration.
Official 1.4.0 packages in both cases, Windows.
However I just ran into an incompatibility issue. All the models I’ve trained using the CUDA package, and saved using torch::save(model,path) can’t be loaded with torch::load(model,path) in the CPU-only package. But the opposite is not true:
-Models trained with the CUDA package can be saved and loaded with the CUDA package but can’t be loaded by the CPU-only package: the software crash without any explanation when torch::load is called.
-Models trained with the CPU package can be saved and loaded with the CPU-only package and the CUDA package.
I’ve uploaded 2 files, one trained with the CPU-only package, one with the GPU package:
Both use the exact same model/training data, saved after only one epoch. They are exactly the same size, and looking at the content in an hex editor, they seem to be structured the same way.
This is quite problematic. Are you aware of this issue ? Loading failed with the nightly build of CPU-only 1.5 as well.