Comments (4)
I have the same problem, but I fix it.
It seems you need set loss.requires_grad = True
and it seems normal.
However, the results is not as good. I don't know why.
Maybe the loss here is for basic model rather than LoRA?
from lora.
Hi, thanks for your exaplaniation. I use another approch to address it.
But my training time is longer.
I have no ideas.
from lora.
Hi, thanks for your exaplaniation. I use another approch to address it.
But my training time is longer.
I have no ideas.
Could you share your method to solve this problem? Thanks!
from lora.
Hi, my approach is to replace all linear module with lora module at first, then try:
lora.mark_only_lora_as_trainable(model)
trainable_params = []
if True:
# if True:
# lora_state_dict = torch.load(model_args.lora_path)
# logger.info(f"Apply LoRA state dict from {model_args.lora_path}.")
# logger.info(lora_state_dict.keys())
# model.load_state_dict(lora_state_dict, strict=False)
trainable_params.append('lora')
if len(trainable_params) > 0:
for name, param in model.named_parameters():
if name.startswith('deberta') or name.startswith('roberta'):
param.requires_grad = False
for trainable_param in trainable_params:
if trainable_param in name:
param.requires_grad = True
break
else:
param.requires_grad = True
from lora.
Related Issues (20)
- Can't reproduce the results for GLUE and hyperparameter misalignment HOT 4
- Layers.py not being executed HOT 1
- Can not reproduce the result of Roberta-Base HOT 2
- how to improve the memory ability of lora fine tuning? HOT 1
- models are the same after loading lora parameters using peft library
- Is it necessary to add `model = model.merge_and_unload()` when training a new LoRA adapter?
- How to adjust LoRA into nn.ConvTranspose2d? HOT 2
- Cannot implement LoRA on a custom model containing transformer encoder from pytorch
- _conv_forward() error
- Dynamic Lora Selection In Runtime❓ HOT 1
- Reproduce Lora results is close but not accurate HOT 2
- Guidance Needed on Continuing Training with a New Dataset via LoRA
- After joining Lora, the first few layers show a gradient of 0
- lora-dim == lora-r ?
- LORA on T5 model
- [Question about multi-gpu training] HOT 1
- question for scale!
- Parameter count on GPT-2 medium
- Where is the LoRA matrices saved?
- Questions about running the cola dataset script HOT 1
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 lora.