question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ModuleNotFoundError: No module named 'transformers.pytorch_transformers'

See original GitHub issue

Hi, thank for your work.

I’m trying to finetune for image captioning task. When i run

python oscar/run_captioning.py \
    --model_name_or_path pretrained_models/base-vg-labels/ep_67_588997 \
    --do_train \
    --do_lower_case \
    --evaluate_during_training \
    --add_od_labels \
    --learning_rate 0.00003 \
    --per_gpu_train_batch_size 64 \
    --num_train_epochs 30 \
    --save_steps 5000 \
    --output_dir output/

I encounter this error

2021-02-04 06:41:10.151589: W tensorflow/stream_executor/platform/default/dso_loader.cc:60] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/local/cuda/lib:/usr/local/cuda/lib64:/usr/local/nvidia/lib:/usr/local/nvidia/lib64
2021-02-04 06:41:10.151621: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
Traceback (most recent call last):
  File "test.py", line 5, in <module>
    from transformers.pytorch_transformers.modeling_utils import PreTrainedModel
ModuleNotFoundError: No module named 'transformers.pytorch_transformers'

I clone this repo with cmd

git clone https://github.com/microsoft/Oscar.git
git submodule init
git submodule update

How could i fix this issue?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12

github_iconTop GitHub Comments

5reactions
alice-coolcommented, Oct 23, 2021

pip uninstall transformers

0reactions
Skyy93commented, Mar 23, 2022

thank you @alice-cool

Read more comments on GitHub >

github_iconTop Results From Across the Web

No Module named Transformers · Issue #3342 - GitHub
Bug No module found transformers Information Package Version absl-py 0.9.0 astor ... ModuleNotFoundError: No module named 'transformers' ...
Read more >
Module Not Found Error when importing Pytorch_Transformers
You are missing the pytorch-transformers dependency. Try installing it with the following command: pip install pytorch-transformers.
Read more >
ModuleNotFoundError: No module named 'pytorch-transformers'
Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'pytorch-transformers' How to remove t.
Read more >
modulenotfounderror: no module named 'transformers' ( Solved )
You will get modulenotfounderror: no module named 'transformers' generally when you will you have not properly installed transformer package on your system.
Read more >
No module named 'pytorch-transformers' - Copy Paste Guru
How to fix "ModuleNotFoundError: No module named 'pytorch-transformers'" ... You must first install the package before you can use it in your code....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found