TypeError: Object of type Tensor is not JSON serializable trainer

#54
by Junheng1 - opened

When I used trainer to fine-tune gemma, I found that I couldn't save it. This error occurred when saving: "TypeError: Object of type Tensor is not JSON serializable trainer". What's the reason?

My environment configuration is as follows:
bitsandbytes==0.42.0
peft==0.8.2
trl==0.7.10
accelerate==0.27.1
datasets==2.17.0
transformers==4.38.1
(torch 2.1.0+cu121)

At the same time, we also tried the following configuration:
torch==2.1.1
torchvision==0.16.1
torchaudio==2.1.1
torchdata==0.7.1
torchtext==0.16.1
transformers==4.38.0

None of the above environments work

Hi @Junheng1
can you share the full traceback of the error and a simple reproducer script?

Thank you for your reply. We have found the source of the problem. The environment is not matching.
If the above problems occur, which needs to
pip install deepspeed==0.13.1
We have tested that this works.

osanseviero changed discussion status to closed

Amazing that it worked @Junheng1 , thanks !

thank you!!!! @Junheng1

Sign up or log in to comment