question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

run_summarization_no_trainer

See original GitHub issue

@sgugger Hello! I just tried to run the code to explore this example https://github.com/huggingface/transformers/blob/main/examples/pytorch/summarization/run_summarization_no_trainer.py

this is my yml file to build the env

name: sum

channels:

  • pytorch
  • conda-forge
  • defaults

dependencies:

  • jupyterlab
  • pip
  • python=3.9
  • pytorch
  • tensorboard
  • torchaudio
  • torchvision
  • tqdm
  • tokenizers
  • prettytable
  • einops
  • matplotlib
  • accelerate
  • datasets
  • sentencepiece != 0.1.92
  • protobuf
  • nltk
  • py7zr
  • transformers

then pip install rouge-score

after that simply I ran thhe command

accelerate launch run_summarization_no_trainer.py --model_name_or_path t5-small --dataset_name cnn_dailymail --dataset_config '3.0.0' --source_prefix 'summarize: ' --output_dir output/tst-summarization

and got the error

Traceback (most recent call last): File “/home/arij/anaconda3/envs/sum/bin/accelerate”, line 10, in <module> sys.exit(main()) File “/home/arij/anaconda3/envs/sum/lib/python3.9/site-packages/accelerate/commands/accelerate_cli.py”, line 43, in main args.func(args) File “/home/arij/anaconda3/envs/sum/lib/python3.9/site-packages/accelerate/commands/launch.py”, line 568, in launch_command simple_launcher(args) File “/home/arij/anaconda3/envs/sum/lib/python3.9/site-packages/accelerate/commands/launch.py”, line 235, in simple_launcher mixed_precision = PrecisionType(args.mixed_precision.lower()) AttributeError: ‘NoneType’ object has no attribute ‘lower’

How to fix it?

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:23 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
soumyasanyalcommented, Jul 19, 2022

Sure! I just followed the steps in this link. The steps I followed are:

accelerate config --config_file ./accelerate.yaml --> answer all the questions in the questionnaire
accelerate test --config_file ./accelerate.yaml
accelerate launch --config_file ./accelerate.yaml script.py

My config file is as follows (but it can change as per your requirements. I just wanted to run a job on 8 GPUs in a single node, without DeepSpeed or mixed precision):

compute_environment: LOCAL_MACHINE
deepspeed_config: {}
distributed_type: MULTI_GPU
fsdp_config: {}
machine_rank: 0
main_process_ip: null
main_process_port: null
main_training_function: main
mixed_precision: 'no'
num_machines: 1
num_processes: 8
use_cpu: false

I was previously running accelerate launch script.py without mentioning the config file when I faced the issue that you reported here.

Also FYI, note that the doc says that integration of accelerate with DeepSpeed is experimental.

1reaction
Arij-Aladelcommented, Nov 18, 2022

Yes , thanks . I am closing it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Summarization - Hugging Face
Summarization creates a shorter version of a document or an article that captures all the important information. Along with translation, it is another ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found