# Error while finding module specification for 'run\_glue.py'

**URL:** <https://discuss.huggingface.co/t/error-while-finding-module-specification-for-run-glue-py/11991>\
**Category:** Amazon SageMaker\
**Created:** [November 17, 2021, 8:24pm UTC](https://discuss.huggingface.co/t/error-while-finding-module-specification-for-run-glue-py/11991 "2021-11-17T20:24:19Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![NDugar](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/ndugar/32/40501_2.png) [@NDugar](https://discuss.huggingface.co/u/NDugar)\
**Post date:** [November 17, 2021, 8:24pm UTC](https://discuss.huggingface.co/t/error-while-finding-module-specification-for-run-glue-py/11991/1 "2021-11-17T20:24:20Z")

</div>

Code written:-

```auto
!pip install git+https://github.com/huggingface/transformers
!python -c "from transformers import pipeline; print(pipeline('sentiment-analysis')('I hate you'))"
!git clone https://github.com/huggingface/transformers.git
%cd "transformers/examples/pytorch/text-classification/"

!python3 -m run_glue.py --model_name_or_path "microsoft/deberta-v3-large" --task_name "mnli" --do_train --do_eval --evaluation_strategy steps --max_seq_length 256 --warmup_steps 50 --per_device_train_batch_size 8 --learning_rate 6e-6 --num_train_epochs 2 --output_dir "ds_results" --overwrite_output_dir --logging_steps 1000 --logging_dir "ds_results"

```

These commands were primarily taken from (and slightly modified) - [microsoft/deberta-v3-large · Hugging Face](https://huggingface.co/microsoft/deberta-v3-large#fine-tuning-with-hf-transformers)  
Error:-

```auto
/home/ec2-user/anaconda3/envs/pytorch_p36/bin/python: Error while finding module specification for 'run_glue.py' (AttributeError: module 'run_glue' has no attribute ' __path__')

```

I have tried this on my own system it didn’t give this error. Am I missing something? @lewtun

---

<div class="post-metadata">

**Author:** ![lewtun](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/lewtun/32/30995_2.png) [@lewtun](https://discuss.huggingface.co/u/lewtun)\
**Post date:** [November 17, 2021, 9:05pm UTC](https://discuss.huggingface.co/t/error-while-finding-module-specification-for-run-glue-py/11991/2 "2021-11-17T21:05:37Z")

</div>

I think the problem is that you’re using the `-m` flag which tries to import `run_glue.py` as a module and then run it. Does it work if you remove the `-m` flag?

---

<div class="post-metadata">

**Author:** ![NDugar](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/ndugar/32/40501_2.png) [@NDugar](https://discuss.huggingface.co/u/NDugar)\
**Post date:** [November 17, 2021, 10:00pm UTC](https://discuss.huggingface.co/t/error-while-finding-module-specification-for-run-glue-py/11991/4 "2021-11-17T22:00:24Z")

</div>

Yes, it worked. thanks.

---

<div class="post-metadata">

**Author:** ![NDugar](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/ndugar/32/40501_2.png) [@NDugar](https://discuss.huggingface.co/u/NDugar)\
**Post date:** [November 17, 2021, 10:03pm UTC](https://discuss.huggingface.co/t/error-while-finding-module-specification-for-run-glue-py/11991/5 "2021-11-17T22:03:51Z")

</div>

Hey @lewtun do you know for how long the sagemaker jupyter notebook remains active on idle? and can it be increased?

---

<div class="post-metadata">

**Author:** ![lewtun](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/lewtun/32/30995_2.png) [@lewtun](https://discuss.huggingface.co/u/lewtun)\
**Post date:** [November 17, 2021, 10:04pm UTC](https://discuss.huggingface.co/t/error-while-finding-module-specification-for-run-glue-py/11991/6 "2021-11-17T22:04:29Z")

</div>

For that question I’ll defer to our SageMaker expert - @philschmid 🙂

---

<div class="post-metadata">

**Author:** ![philschmid](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/philschmid/32/38022_2.png) [@philschmid](https://discuss.huggingface.co/u/philschmid)\
**Post date:** [November 18, 2021, 7:47am UTC](https://discuss.huggingface.co/t/error-while-finding-module-specification-for-run-glue-py/11991/7 "2021-11-18T07:47:13Z")

</div>

@NDugar I would rather recommend running your training using the `HuggingFace` estimator than the Notebook Instance. SageMaker will handle the management of the resources behind the scene and makes sure the training runs.

---

<div class="post-metadata">

**Author:** ![NDugar](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/ndugar/32/40501_2.png) [@NDugar](https://discuss.huggingface.co/u/NDugar)\
**Post date:** [November 18, 2021, 10:50am UTC](https://discuss.huggingface.co/t/error-while-finding-module-specification-for-run-glue-py/11991/8 "2021-11-18T10:50:42Z")

</div>

can you share an example on how to do that? also will it have enough space and RAM to train deberta v3 large on mnli?

---

<div class="post-metadata">

**Author:** ![philschmid](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/philschmid/32/38022_2.png) [@philschmid](https://discuss.huggingface.co/u/philschmid)\
**Post date:** [November 18, 2021, 12:27pm UTC](https://discuss.huggingface.co/t/error-while-finding-module-specification-for-run-glue-py/11991/9 "2021-11-18T12:27:59Z")

</div>

Here is a example notebook: [huggingface-course-sagemaker-talk/sagemaker-notebook.ipynb at master · philschmid/huggingface-course-sagemaker-talk · GitHub](https://github.com/philschmid/huggingface-course-sagemaker-talk/blob/master/sagemaker-notebook.ipynb)  
The repository contains a example script `train.py` if you want to write your own fine-tuning script and if you want to use the `example/` scripts of transformers the notebook also includes instructions for that.
