Closed NguyenVanThanhHust closed 3 years ago
Check if u have a transformers folder and files and put right directory path on the code.
Hi @brightbsit,
I have transformers folder, i git cloned that folder in above comment. I checked file in that folder too. There are folder pytorch_transformers.
And what do you mean about " put right directory path on the code"?
I clone from this git, both main and submodule. Am I supposed to put folder "transformers" somewhere else?
I also have the same error and change the path on the code.
change the line 5 in file "test.py". also "python setup.py build develop" might help.
How shoud i change that line ? This is line 5
from transformers.pytorch_transformers.modeling_utils import PreTrainedModel
What should i change it too?
Umm it depends on the folder states. I think i just add . In the beginning
Is this what you mean?
from .transformers.pytorch_transformers.modeling_utils import PreTrainedModel
If so then the error is:
Traceback (most recent call last):
File "test.py", line 5, in <module>
from .transformers.pytorch_transformers.modeling_utils import PreTrainedModel
ImportError: attempted relative import with no known parent package
And what do you mean about folder states? I leaves the folder structure as in git.
And python setup.py build develop
doesn't work either.
I don't have any problem with the test. But I can't find test.py file on my oscar folder. Where did u get test.py file?
the code will be gone when you fix the path.
test.py is a file i created. Error happen 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 know error happended because of it can't import file.
To reduce time, i copy import code from oscar/run_captioning.py
To replicate error, you can run original cmd.
It creates exactly same error.
what is the error code when you type python setup.py build develop
?
I don't see any error when i run sudo python3.7 setup.py build develop
.
Thank you for your patience.
I just build a docker and run it in docker.
I suspect this error has something to do with call library.
pip uninstall transformers
thank you @alice-cool
Hi, thank for your work.
I'm trying to finetune for image captioning task. When i run
I encounter this error
I clone this repo with cmd
How could i fix this issue?