Permisson error appears and the model stops working. When I searched it, it said it was an access or path setting problem, but I don't know which part to fix.
Full error message
Traceback (most recent call last):
File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\groove2groove\models\roll2seq_style_transfer.py", line 407, in
main()
File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\groove2groove\models\roll2seq_style_transfer.py", line 401, in main
args.func(experiment, args)
File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\groove2groove\models\roll2seq_style_transfer.py", line 186, in run_midi
pipeline.save(sequences, args.output_file)
File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\groove2groove\io.py", line 303, in save
midi_io.note_sequence_to_midi_file(sequence, path)
File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\note_seq\midi_io.py", line 217, in note_sequence_to_midi_file
copyfile(temp_file.name, output_file)
File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\shutil.py", line 120, in copyfile
with open(src, 'rb') as fsrc:
PermissionError: [Errno 13] Permission denied: 'C:\Users\user\AppData\Local\Temp\tmp853_r9ai'
style_transfer.py
def run_midi(self, args):
pipeline = MidiPipeline(source_path=args.source_file, style_path=args.style_file,
bars_per_segment=args.bars_per_segment, warp=True)
sequences = self._run_cli(args, pipeline)
pipeline.save(sequences, args.output_file)
io.py
def save(self, sequences, path):
sequence = self._seq_pipeline.postprocess(sequences)
midi_io.note_sequence_to_midi_file(sequence, path)
I've seen a lot of people saying that there's a problem if the path is a folder.
python -m groove2groove.models.roll2seq_style_transfer --logdir 'D:\groove2groove\experiments\v01_drums' run-midi \
--sample --softmax-temperature 0.6 \
content.mid style.mid output.mid
However, the path to the folder was never entered when the terminal entered it...
Related
As you can see, I use the right command and it keeps telling me the usage instead of creating the right file for me.
enter image description here
(WebScraping) G:\>pipreqs G:\PY CODE\WebScraping
Usage:
pipreqs [options] [<path>]
And if I just randomly input the path file, it will tell me, file doesn`t exist.
(WebScraping) G:\>pipreqs s
Traceback (most recent call last):
File "D:\anaconda\envs\WebScraping\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "D:\anaconda\envs\WebScraping\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "D:\anaconda\envs\WebScraping\Scripts\pipreqs.exe\__main__.py", line 7, in <module>
File "D:\anaconda\envs\WebScraping\lib\site-packages\pipreqs\pipreqs.py", line 488, in main
init(args)
File "D:\anaconda\envs\WebScraping\lib\site-packages\pipreqs\pipreqs.py", line 478, in init
generate_requirements_file(path, imports, symbol)
File "D:\anaconda\envs\WebScraping\lib\site-packages\pipreqs\pipreqs.py", line 157, in generate_requirements_file
with _open(path, "w") as out_file:
File "D:\anaconda\envs\WebScraping\lib\contextlib.py", line 135, in __enter__
return next(self.gen)
File "D:\anaconda\envs\WebScraping\lib\site-packages\pipreqs\pipreqs.py", line 81, in _open
file = open(filename, mode)
FileNotFoundError: [Errno 2] No such file or directory: 's\\requirements.txt'
I finally solve this issue when I cd my host path in cmd to the document path without giving arguments in pipreqs order like this:
(WebScraping) G:\PY CODE\WebScraping>pipreqs --encoding=utf8
INFO: Successfully saved requirements file in G:\PY CODE\WebScraping\requirements.txt
But how can I use the normal orders like eveyone else:
G:\PY CODE\WebScraping
This keeps bothering me
I wonder is there someth
Try adding quotes:
pipreqs "G:\PY CODE\WebScraping"
I have a script that is called from DJango, but it doesn't execute instead it gives PermissionError: [Errno 13] Permission denied. I'm using CMD on Windows as admin.
Here is how I'm calling:
cmd = os.path.join(os.getcwd(), "D:/commerceTest/cs50-commerceM/Photo/GFPGAN/inference_gfpgan.py --upscale 2 --model_path D:/commerceTest/cs50-commerceM/Photo/GFPGAN/experiments/pretrained_models/ --test_path inputs/whole_imgs/GFPGANCleanv1-NoCE-C2.pth --save_root D:/commerceTest/cs50-commerceM/Photo/GFPGAN/results")
#os.system("python D:/commerceTest/cs50-commerceM/Photo/GFPGAN/inference_gfpgan.py --upscale 2 --model_path D:/commerceTest/cs50-commerceM/Photo/GFPGAN/experiments/pretrained_models/ --test_path inputs/whole_imgs/GFPGANCleanv1-NoCE-C2.pth --save_root D:/commerceTest/cs50-commerceM/Photo/GFPGAN/results")
os.system('{} {}'.format('python', cmd))
Here is the message I received:
Traceback (most recent call last):
File "D:\commerceTest\cs50-commerceM\Photo\GFPGAN\inference_gfpgan.py", line 98, in <module>
main()
File "D:\commerceTest\cs50-commerceM\Photo\GFPGAN\inference_gfpgan.py", line 52, in main
restorer = GFPGANer(
File "D:\commerceTest\cs50-commerceM\Photo\GFPGAN\gfpgan\utils.py", line 60, in __init__
loadnet = torch.load(model_path)
File "D:\Users\rapha\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\serialization.py", line 594, in load
with _open_file_like(f, 'rb') as opened_file:
File "D:\Users\rapha\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\serialization.py", line 230, in _open_file_like
return _open_file(name_or_buffer, mode)
File "D:\Users\rapha\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\serialization.py", line 211, in __init__
super(_open_file, self).__init__(open(name, mode))
PermissionError: [Errno 13] Permission denied: 'D:/commerceTest/cs50-commerceM/Photo/GFPGAN/experiments/pretrained_models/'
I can only guess here but the error that you are getting is because Python is trying to open a directory as a file (which won't work).
It looks like the path that you are passing in to --model_path is a directory but torch.load() expects a file, that would explain it.
I would start with understanding what exactly the script inference_gfpgan.py does and how it works.
Description
When I tried to open the clone notebook, this happened
When I looked at my command line, this error show up
Traceback (most recent call last):
File "C:\Users\msi\Anaconda3\lib\site-packages\tornado\web.py", line 1704, in _execute
result = await result
File "C:\Users\msi\Anaconda3\lib\site-packages\jupyter_server\services\contents\handlers.py", line 248, in post
checkpoint = await ensure_async(cm.create_checkpoint(path))
File "C:\Users\msi\Anaconda3\lib\site-packages\jupyter_server\services\contents\manager.py", line 520, in create_checkpoint
return self.checkpoints.create_checkpoint(self, path)
File "C:\Users\msi\Anaconda3\lib\site-packages\jupyter_server\services\contents\filecheckpoints.py", line 59, in create_checkpoint
self._copy(src_path, dest_path)
File "C:\Users\msi\Anaconda3\lib\site-packages\jupyter_server\services\contents\fileio.py", line 245, in _copy
copy2_safe(src, dest, log=self.log)
File "C:\Users\msi\Anaconda3\lib\site-packages\jupyter_server\services\contents\fileio.py", line 47, in copy2_safe
shutil.copyfile(src, dst)
File "C:\Users\msi\Anaconda3\lib\shutil.py", line 261, in copyfile
with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\msi\\My study\\AIT Coursework\\AT82.01 Computer Programming for Data Science and Artificial Intelligence\\Python-for-DS-AI\\Lectures\\02-MLScratch\\03-Naive Bayesian\\.ipynb_checkpoints\\01 - Supervised Learning - Classification - Naive Bayesian - Gaussian-checkpoint.ipynb'
[W 2021-08-23 17:00:07.499 ServerApp] Unhandled error
It worked perfectly when I import it to Colab, so the notebook file is not corrupted.
I still don't understand what is the problem, not having a checkpoint file shouldnt be the problem in the first place.
Anyone got a clue on what happened?
Never mind, I fixed it. it's because my file name is too long.
I am trying to lemmatize a Latin text using Python 3.5 in Pycharm 5.0.4 with the CLTK library, but there seems to be a problem with Git. I get the error git.exc.GitCommandNotFound: [WinError 2] The system cannot find the file specified among other errors I believe are related—see below for the full output. I have tried adding a Git repository to the project folder and adding the git.exe path to version control but that seems to have done nothing. What can I do to get Git to work properly—please keep in mind that I am a complete neophyte when it comes to Python in particular and not very experienced with programming in general.
Code:
from cltk.stem.lemma import LemmaReplacer
from cltk.stem.latin.j_v import JVReplacer
from cltk.corpus.utils.importer import CorpusImporter
corpus_importer = CorpusImporter('latin')
corpus_importer.import_corpus('latin_text_latin_library')
corpus_importer.import_corpus('latin_models_cltk')
#corpus_importer.import_corpus('phi5', '~/PHI5/')
#t.convert_corpus(corpus='phi5')
j = JVReplacer()
lemmatizer = LemmaReplacer('latin')
In = open("CIC.txt","rt")
Out = open("CIC4.txt","wt")
text = In.read()
text = text.lower()
text = j.replace(text)
Out.write(str(lemmatizer.lemmatize(text)))
In.close()
Out.close()
Output:
C:\Users\Rune\AppData\Local\Programs\Python\Python35-32\python.exe "C:\Program Files (x86)\JetBrains\PyCharm 5.0.4\helpers\pydev\pydevd.py" --multiproc --qt-support --client 127.0.0.1 --port 58508 --file C:/Users/Rune/PycharmProjects/untitled/Pucker.py
pydev debugger: process 14648 is connecting
Connected to pydev debugger (build 143.1919)
--- Logging error ---
Traceback (most recent call last):
File "C:\Users\Rune\AppData\Local\Programs\Python\Python35-32\lib\site-packages\git\cmd.py", line 604, in execute
**subprocess_kwargs
File "C:\Users\Rune\AppData\Local\Programs\Python\Python35-32\lib\subprocess.py", line 950, in __init__
restore_signals, start_new_session)
File "C:\Users\Rune\AppData\Local\Programs\Python\Python35-32\lib\subprocess.py", line 1220, in _execute_child
startupinfo)
File "C:\Program Files (x86)\JetBrains\PyCharm 5.0.4\helpers\pydev\pydev_monkey.py", line 387, in new_CreateProcess
return getattr(_subprocess, original_name)(appName, patch_arg_str_win(commandLine), *args)
FileNotFoundError: [WinError 2] The system cannot find the file specified
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Rune\AppData\Local\Programs\Python\Python35-32\lib\site-packages\cltk\corpus\utils\importer.py", line 134, in import_corpus
Repo.clone_from(git_uri, target_dir, depth=1)
File "C:\Users\Rune\AppData\Local\Programs\Python\Python35-32\lib\site-packages\git\repo\base.py", line 885, in clone_from
return cls._clone(git, url, to_path, GitCmdObjectDB, progress, **kwargs)
File "C:\Users\Rune\AppData\Local\Programs\Python\Python35-32\lib\site-packages\git\repo\base.py", line 826, in _clone
v=True, **add_progress(kwargs, git, progress))
File "C:\Users\Rune\AppData\Local\Programs\Python\Python35-32\lib\site-packages\git\cmd.py", line 450, in <lambda>
return lambda *args, **kwargs: self._call_process(name, *args, **kwargs)
File "C:\Users\Rune\AppData\Local\Programs\Python\Python35-32\lib\site-packages\git\cmd.py", line 878, in _call_process
return self.execute(make_call(), **_kwargs)
File "C:\Users\Rune\AppData\Local\Programs\Python\Python35-32\lib\site-packages\git\cmd.py", line 607, in execute
raise GitCommandNotFound(str(err))
git.exc.GitCommandNotFound: [WinError 2] The system cannot find the file specified
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Rune\AppData\Local\Programs\Python\Python35-32\lib\logging\__init__.py", line 980, in emit
msg = self.format(record)
File "C:\Users\Rune\AppData\Local\Programs\Python\Python35-32\lib\logging\__init__.py", line 830, in format
return fmt.format(record)
File "C:\Users\Rune\AppData\Local\Programs\Python\Python35-32\lib\logging\__init__.py", line 567, in format
record.message = record.getMessage()
File "C:\Users\Rune\AppData\Local\Programs\Python\Python35-32\lib\logging\__init__.py", line 330, in getMessage
msg = msg % self.args
TypeError: not enough arguments for format string
Call stack:
File "C:\Program Files (x86)\JetBrains\PyCharm 5.0.4\helpers\pydev\pydevd.py", line 2411, in <module>
globals = debugger.run(setup['file'], None, None, is_module)
File "C:\Program Files (x86)\JetBrains\PyCharm 5.0.4\helpers\pydev\pydevd.py", line 1802, in run
launch(file, globals, locals) # execute the script
File "C:\Program Files (x86)\JetBrains\PyCharm 5.0.4\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "C:/Users/Rune/PycharmProjects/untitled/Pucker.py", line 5, in <module>
corpus_importer.import_corpus('latin_text_latin_library')
File "C:\Users\Rune\AppData\Local\Programs\Python\Python35-32\lib\site-packages\cltk\corpus\utils\importer.py", line 136, in import_corpus
logger.error("Git clone of '%s' failed: '%s'", (git_uri, e))
Message: "Git clone of '%s' failed: '%s'"
Arguments: (('https://github.com/cltk/latin_text_latin_library.git', GitCommandNotFound('[WinError 2] The system cannot find the file specified',)),)
Process finished with exit code 0
You can manually download the corpus from https://github.com/cltk/latin_models_cltk and place it in the
~/cltk_data/latin/model/ folder (so ~/cltk_data/latin/model/latin_models_cltk/lemmata/ is an existing folder afterwards). Then you should be able to run the following just fine:
from cltk.stem.lemma import LemmaReplacer
LemmaReplacer('latin').lemmatize('some_latin_here')
For the same in Greek, just replace the 'latin' by 'greek' everywhere in these instructions. I imagine (but haven't tried) that it works the same for other languages too.
I am pretty sure that CLTK does not work with any Python version below 3.6, at least as of August 2017. I had a devil of a time getting 3.6 installed on Ubuntu (Ubuntu linus running dual boot from my PC laptop) but eventually got it to work. Also I specifically solved the problem that OP articulates above by following the instructions at https://disiectamembra.wordpress.com/2016/07/01/current-state-of-the-cltk-latin-lemmatizer/. Good luck!
i'm trying to make my first django project, startproject runs fine but when i try runserver this is the traceback error i get :
File "C:\Python27\lib\site-packages\django-1.9-py2.7.egg\django\contrib\auth\f orms.py", line 269, in SetPasswordForm
help_text=password_validation.password_validators_help_text_html())
File "C:\Python27\lib\site-packages\django-1.9-py2.7.egg\django\contrib\auth\password_validation.py", line 85, in password_validators_help_text_html
help_texts = password_validators_help_texts(password_validators)
File "C:\Python27\lib\site-packages\django-1.9-py2.7.egg\django\contrib\auth\password_validation.py", line 74, in password_validators_help_texts
password_validators = get_default_password_validators()
File "C:\Python27\lib\site-packages\django-1.9-py2.7.egg\django\utils\lru_cach e.py", line 101, in wrapper
result = user_function(*args, **kwds)
File "C:\Python27\lib\site-packages\django-1.9-py2.7.egg\django\contrib\auth\p assword_validation.py", line 21, in get_default_password_validators
return get_password_validators(settings.AUTH_PASSWORD_VALIDATORS)
File "C:\Python27\lib\site-packages\django-1.9-py2.7.egg\django\contrib\auth\p assword_validation.py", line 32, in get_password_validators
validators.append(klass(**validator.get('OPTIONS', {})))
File "C:\Python27\lib\site-packages\django-1.9-py2.7.egg\django\contrib\auth\p assword_validation.py", line 164, in __init__
with open(password_list_path) as f: IOError: [Errno 2] No such file or directory: u'C:\\Python27\\lib\\site-packages \\django-1.9-py2.7.egg\\django\\contrib\\auth\\common-passwords.txt.gz'
i'm at my wits end here, please help
Your django 1.9 installation is misssing common-passwords.txt.gz file.
Try to install pip install django-password-validation that seems to be required by this version. Or just put the file manually to C:\Python27\lib\site-packages\django-1.9-py2.7.egg\django\contrib\auth\