microsoft / Oscar

Oscar and VinVL

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ModuleNotFoundError: No module named 'oscar'

kssscrl opened this issue · comments

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!!

捕获

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