File "/home/reason/anaconda3/envs/deepfake-roop/lib/python3.8/shutil.py", line 264, in copyfile with open(src, 'rb') as fsrc, open(dst, 'wb') a
时间: 2023-12-31 20:04:34 浏览: 213
这个错误提示说明程序无法将源文件复制到目标文件,可能是因为源文件不存在或者无法读取,或者目标文件无法写入。请检查源文件是否存在,并且确认路径是否正确。如果源文件不存在,则需要使用正确的文件名或生成源文件。如果源文件存在但无法读取,请检查文件权限是否正确。如果目标文件无法写入,则需要更改目标文件的权限或更改目标文件名称以避免文件冲突。
相关问题
Traceback (most recent call last): File "run.py", line 231, in <module> start() File "run.py", line 217, in start add_audio(output_dir, target_path, args['keep_frames'], args['output_file']) File "/home/reason/Downloads/roop-main/core/utils.py", line 54, in add_audio shutil.move(output_dir + f"/output.mp4", save_to) File "/home/reason/anaconda3/envs/deepfake-roop/lib/python3.8/shutil.py", line 811, in move copy_function(src, real_dst) File "/home/reason/anaconda3/envs/deepfake-roop/lib/python3.8/shutil.py", line 435, in copy2 copyfile(src, dst, follow_symlinks=follow_symlinks) File "/home/reason/anaconda3/envs/deepfake-roop/lib/python3.8/shutil.py", line 264, in copyfile with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst: FileNotFoundError: [Errno 2] No such file or directory: '/home/reason/Documents/MJ/output.mp4'
这个错误提示说明程序无法在指定路径找到文件 "/home/reason/Documents/MJ/output.mp4",可能是因为文件不存在或者路径不正确。请检查文件是否存在,并且确认路径是否正确。如果文件不存在,请确保程序生成了输出文件并且输出文件名正确。如果路径不正确,则需要更改路径以指向正确的文件位置。
06/06/2023-16:31:47] [TRT] [I] [MemUsageChange] TensorRT-managed allocation in IExecutionContext creation: CPU +0, GPU +0, now: CPU 0, GPU 0 (MiB) /home/sniper/anaconda3/envs/labelme/lib/python3.8/site-packages/tensorrt/__init__.py:166: FutureWarning: In the future `np.bool` will be defined as the corresponding NumPy scalar. bool: np.bool, Traceback (most recent call last): File "/home/sniper/anaconda3/envs/labelme/bin/yolo", line 8, in <module> sys.exit(entrypoint()) File "/home/sniper/anaconda3/envs/labelme/lib/python3.8/site-packages/ultralytics/yolo/cfg/__init__.py", line 398, in entrypoint getattr(model, mode)(**overrides) # default args from model File "/home/sniper/anaconda3/envs/labelme/lib/python3.8/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context return func(*args, **kwargs) File "/home/sniper/anaconda3/envs/labelme/lib/python3.8/site-packages/ultralytics/yolo/engine/model.py", line 302, in val validator(model=self.model) File "/home/sniper/anaconda3/envs/labelme/lib/python3.8/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context return func(*args, **kwargs) File "/home/sniper/anaconda3/envs/labelme/lib/python3.8/site-packages/ultralytics/yolo/engine/validator.py", line 114, in __call__ model = AutoBackend(model, device=self.device, dnn=self.args.dnn, data=self.args.data, fp16=self.args.half) File "/home/sniper/anaconda3/envs/labelme/lib/python3.8/site-packages/ultralytics/nn/autobackend.py", line 174, in __init__ dtype = trt.nptype(model.get_binding_dtype(i)) File "/home/sniper/anaconda3/envs/labelme/lib/python3.8/site-packages/tensorrt/__init__.py", line 166, in nptype bool: np.bool, File "/home/sniper/anaconda3/envs/labelme/lib/python3.8/site-packages/numpy/__init__.py", line 305, in __getattr__ raise AttributeError(__former_attrs__[attr]) AttributeError: module 'numpy' has no attribute 'bool'. `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations 如何修复
这个错误是由于使用了在NumPy 1.20中被废弃的`np.bool`别名所引起的。可以将`np.bool`替换为`bool`来避免这个错误。可以在代码中查找`np.bool`并将其替换为`bool`。如果你确实需要使用NumPy的布尔类型,可以使用`np.bool_`。你可以查看NumPy 1.20的发布说明以获取更多详细信息和指导。
阅读全文