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

ModuleNotFoundError: No module named 'oscar' #204

Open
kssscrl opened this issue Mar 25, 2023 · 1 comment
Open

ModuleNotFoundError: No module named 'oscar' #204

kssscrl opened this issue Mar 25, 2023 · 1 comment

Comments

@kssscrl
Copy link

kssscrl commented Mar 25, 2023

Sorry, I am a beginner. When I try to run run_captioning.py following the author's instruction on colab , it raised ModuleNotFoundError: No module named 'oscar'. However, there is init.py in the oscar folder, it should be treated as a module I think. Could anyone provide some advice? I am under the Oscar folder and 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/"
Just like the attached screenshot shows.
Thank you so much!!

捕获

@yongliang-wu
Copy link

I add to this script

import sys
import os

current_dir = os.path.dirname(os.path.abspath(__file__))
parent_dir = os.path.dirname(current_dir)
sys.path.append(parent_dir)

And the problem is solved

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