Skip to content
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

About the error running the train_retriever.py #5

Open
XiangyanChen opened this issue Mar 14, 2024 · 1 comment
Open

About the error running the train_retriever.py #5

XiangyanChen opened this issue Mar 14, 2024 · 1 comment

Comments

@XiangyanChen
Copy link

Hi! I'm interested in your work.
After I ran encode_comments.py, retrieval.py, and recent.py from preprocess, I tried to run train_retriever.py, but I encountered a problem "RuntimeError: "clamp_min_cpu" not implemented for 'Half'" when running "style_reps = torch.nn.functional.normalize(style_reps, dim=-1)". I searched on Google, and it seems that the train_retriever.py was run on the CPU.
Since I'm not familiar with Pytorch, I seek help from you.

@shuailiu6626
Copy link
Collaborator

Hi! Thank you for your interest in our work! I'm really sorry for the late response. We use the Trainer class from the transformers library (version 4.17.0) in train_retriever.py which should automatically move the model to CUDA if CUDA is available. Could you please check whether you have CUDA and PyTorch set up correctly by running python -c "import torch; print(torch.cuda.is_available())" from command line?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants