accelerate icon indicating copy to clipboard operation
accelerate copied to clipboard

Running with Pycharm debugger

Open Seohyeong opened this issue 3 years ago • 4 comments

I'm trying to run a script with accelerate on Pycharm debugger. I've come across issue-535 and followed the steps. However, I'm getting the following lines of error.

Traceback (most recent call last): File "/home/envs/HF/lib/python3.7/site-packages/accelerate/commands/launch.py", line 280, in simple_launcher mixed_precision = PrecisionType(args.mixed_precision.lower()) AttributeError: 'NoneType' object has no attribute 'lower' python-BaseException

Do I need additional parameters when running with module accelerate.commands.launch?

Screen Shot 2022-08-02 at 4 13 38 PM

Seohyeong avatar Aug 02 '22 07:08 Seohyeong

You need to still configure accelerate. Run accelerate config from thr CLI. This error will be much more clear in the next release.

Here's the new docs talking about launch https://huggingface.co/docs/accelerate/main/en/basic_tutorials/launch

(The helpers it mentions about being able to guess and pass in non-configured launches won't be live until the next release here this week, or install from github following the install directions)

muellerzr avatar Aug 02 '22 09:08 muellerzr

Thanks for the comment!

I configured running accelerate config. However, I'm getting another error. Though it seems like either a python subprocess error or a compatibility problem between accelerate and subprocess, I'm sharing the error message here in case you've seen something similar before.

Traceback (most recent call last):
  File "/home/.conda/envs/ltr/lib/python3.7/subprocess.py", line 800, in __init__
    restore_signals, start_new_session)
  File "/home/.conda/envs/ltr/lib/python3.7/subprocess.py", line 1551, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'torchrun': 'torchrun'
python-BaseException

Seohyeong avatar Aug 02 '22 15:08 Seohyeong

Is pytorch installed? How did you install accelerate?

muellerzr avatar Aug 02 '22 15:08 muellerzr

Pytorch is installed. I installed accelerate through pip install accelerate and ran accelerate config right after.

Seohyeong avatar Aug 02 '22 15:08 Seohyeong

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

github-actions[bot] avatar Sep 01 '22 15:09 github-actions[bot]

@SeoHyeong Has you solved the "FileNotFoundError: [Errno 2] No such file or directory: 'torchrun': 'torchrun'" error? Run into the same bug for some other project.

sunformoon avatar Nov 28 '22 00:11 sunformoon