e01 icon indicating copy to clipboard operation
e01 copied to clipboard

Cannot run sh run.sh without errors

Open craine opened this issue 4 years ago • 1 comments

Love the video tutorials but I'm constantly getting errors on the pkl files and cannot resolve. See below:

(base) charlies-mbp-2:ml-proj-template craine$ sh run.sh 0 Traceback (most recent call last): File "/Users/craine/opt/anaconda3/lib/python3.7/runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "/Users/craine/opt/anaconda3/lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "/Users/craine/Documents/workspace/ml-proj-template/src/predict.py", line 47, in <module> submission = predict() File "/Users/craine/Documents/workspace/ml-proj-template/src/predict.py", line 22, in predict encoders = joblib.load(os.path.join("models", f"{MODEL}_{FOLD}_label_encoder.pkl")) File "/Users/craine/opt/anaconda3/lib/python3.7/site-packages/joblib/numpy_pickle.py", line 597, in load with open(filename, 'rb') as f: FileNotFoundError: [Errno 2] No such file or directory: 'models/_0_label_encoder.pkl'

craine avatar Apr 16 '20 18:04 craine

Hi @craine. You are facing this issue becase:

  1. In the video tutorial, @abhishekkrthakur has initially trained the model. After that he commented out the required code for training model - Lines 6-10 in run.sh.
  2. It seems that you haven't trained the model look at line 51 in train.py.

To solve this problem, just uncomment the lines 6-10 in run.sh and it should work just fine.

manikanthr5 avatar May 26 '20 06:05 manikanthr5