Comments (7)
You can use:
torch.save(model, your_model_path)
Then load it to do inference:
model = torch.load(model_path) model.eval()
For more information: https://pytorch.org/tutorials/beginner/saving_loading_models.html
from efficient-kan.
Have you tried this? Not work for me. Because the torch saving seems to use the pickle too.
AttributeError: Can't pickle local object 'Symbolic_KANLayer.__init__.<locals>.<listcomp>.<listcomp>.<lambda>'
from efficient-kan.
Can you show me your code?
from efficient-kan.
@binhnguyen7tiki Please post the full error message.
@binhna I don't think my implementation includes Symbolic_KANLayer
. It should be part of the official implementation.
BTW, it seems the two accounts are the same person? Correct me if I'm wrong.
from efficient-kan.
Have you tried this? Not work for me. Because the torch saving seems to use the pickle too.
AttributeError: Can't pickle local object 'Symbolic_KANLayer.__init__.<locals>.<listcomp>.<listcomp>.<lambda>'
Do you use the original KAN (https://github.com/KindXiaoming/pykan) for training your model? Then, ask them there better.
from efficient-kan.
Seemingly unrelated to this repo. Close for now and if I'm wrong I'll reopen it.
from efficient-kan.
@Blealtan @hoangthangta sorry for the late reply, and yes, I checked the code again and it was the original KAN indeed. I switched to efficient-kan now and everything seems to be fine.
Thank you guys for your help.
PS: @Blealtan correct! it was the same guy, I accidentally used my work account in the first place.
from efficient-kan.
Related Issues (20)
- RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.cuda.FloatTensor [800, 256]], which is output 0 of AsStridedBackward0, is at version 2; expected version 1 instead. Hint: enable anomaly detection to find the operation that failed to compute its gradient, with torch.autograd.set_detect_anomaly(True). HOT 1
- Difference in memory usage of mlp and kan HOT 1
- CUDA out of memory. HOT 2
- please report a bug to PyTorch. torch.linalg.lstsq: (Batch element 0): Argument 6 has illegal value. Most certainly there is a bug in the implementation calling the backend library. HOT 1
- AssertionError HOT 1
- Symbolic Formulation from efficient-KAN HOT 1
- Can configure efficient-kan model for continual learning? HOT 9
- Can still plot model and prune model in efficient kan? HOT 11
- Train Multi-KANs simultaneously! Coding realization HOT 2
- Layer fails on inputs that have been transposed previously HOT 1
- Something different from the official results for KAN. HOT 1
- ONNX
- How to pip install? HOT 3
- block: [0,0,0], thread: [1,0,0] Assertion `input_val >= zero && input_val <= one` failed. when using BCEloss
- which types of images could be better recognised using KAN approach?
- I would like to add a train test function to the KAN class
- flops and params
- Questions
- How to cite HOT 1
- Constant loss, network is not learning 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 efficient-kan.