From 3f68ce813365f28fc28048a346f91f399867b82b Mon Sep 17 00:00:00 2001 From: Anjok07 <68268275+Anjok07@users.noreply.github.com> Date: Wed, 11 May 2022 16:05:05 -0500 Subject: [PATCH] Add files via upload --- UVR.py | 11 +++++------ inference_MDX.py | 26 ++++++++++++++++++++++++++ inference_v5.py | 2 ++ inference_v5_ensemble.py | 27 +++++++++++++++++++++++++++ 4 files changed, 60 insertions(+), 6 deletions(-) diff --git a/UVR.py b/UVR.py index be09061..6227261 100644 --- a/UVR.py +++ b/UVR.py @@ -1,5 +1,10 @@ # GUI modules import os +try: + with open(os.path.join(os.getcwd(), 'tmp', 'splash.txt'), 'w') as f: + f.write('1') +except: + pass import pyperclip from gc import freeze import tkinter as tk @@ -66,7 +71,6 @@ mdx_opt_path = os.path.join(base_path, 'img', 'mdx_opt.png') vr_opt_path = os.path.join(base_path, 'img', 'vr_opt.png') ense_opt_path = os.path.join(base_path, 'img', 'ense_opt.png') user_ens_opt_path = os.path.join(base_path, 'img', 'user_ens_opt.png') -more_info_path = os.path.join(base_path, 'img', 'more_info.png') credits_path = os.path.join(base_path, 'img', 'credits.png') DEFAULT_DATA = { @@ -277,8 +281,6 @@ class MainWindow(TkinterDnD.Tk): size=(1016, 826)) self.user_ens_opt_img = open_image(path=user_ens_opt_path, size=(1016, 826)) - self.more_info_img = open_image(path=more_info_path, - size=(1016, 826)) self.credits_img = open_image(path=credits_path, size=(100, 100)) @@ -334,9 +336,6 @@ class MainWindow(TkinterDnD.Tk): self.progress_var = tk.IntVar(value=0) # Font pyglet.font.add_file('lib_v5/fonts/centurygothic/GOTHIC.TTF') - pyglet.font.add_file('lib_v5/fonts/unispace/unispace.ttf') - #Font(file="lib_v5/fonts/centurygothic/GOTHIC.TTF", family="Century Gothic") - #Font(file="lib_v5/fonts/unispace/unispace.ttf", family="Unispace") self.font = tk.font.Font(family='Century Gothic', size=10) self.fontRadio = tk.font.Font(family='Century Gothic', size=8) # --Widgets-- diff --git a/inference_MDX.py b/inference_MDX.py index 276419d..ba1b40a 100644 --- a/inference_MDX.py +++ b/inference_MDX.py @@ -709,6 +709,7 @@ def main(window: tk.Wm, text_widget: tk.Text, button_widget: tk.Button, progress #Error Handling onnxmissing = "[ONNXRuntimeError] : 3 : NO_SUCHFILE" + onnxmemerror = "onnxruntime::CudaCall CUDA failure 2: out of memory" runtimeerr = "CUDNN error executing cudnnSetTensorNdDescriptor" cuda_err = "CUDA out of memory" mod_err = "ModuleNotFoundError" @@ -716,6 +717,7 @@ def main(window: tk.Wm, text_widget: tk.Text, button_widget: tk.Button, progress ffmp_err = """audioread\__init__.py", line 116, in audio_open""" sf_write_err = "sf.write" + try: with open('errorlog.txt', 'w') as f: f.write(f'No errors to report at this time.' + f'\n\nLast Process Method Used: MDX-Net' + @@ -958,6 +960,30 @@ def main(window: tk.Wm, text_widget: tk.Text, button_widget: tk.Button, progress button_widget.configure(state=tk.NORMAL) # Enable Button return + if onnxmemerror in message: + text_widget.write("\n" + base_text + f'Separation failed for the following audio file:\n') + text_widget.write(base_text + f'"{os.path.basename(music_file)}"\n') + text_widget.write(f'\nError Received:\n\n') + text_widget.write(f'The application was unable to allocate enough GPU memory to use this model.\n') + text_widget.write(f'\nPlease do the following:\n\n1. Close any GPU intensive applications.\n2. Lower the set chunk size.\n3. Then try again.\n\n') + text_widget.write(f'If the error persists, your GPU might not be supported.\n\n') + text_widget.write(f'Time Elapsed: {time.strftime("%H:%M:%S", time.gmtime(int(time.perf_counter() - stime)))}') + try: + with open('errorlog.txt', 'w') as f: + f.write(f'Last Error Received:\n\n' + + f'Error Received while processing "{os.path.basename(music_file)}":\n' + + f'Process Method: MDX-Net\n\n' + + f'The application was unable to allocate enough GPU memory to use this model.\n' + + f'\nPlease do the following:\n\n1. Close any GPU intensive applications.\n2. Lower the set chunk size.\n3. Then try again.\n\n' + + f'If the error persists, your GPU might not be supported.\n\n' + + message + f'\nError Time Stamp [{datetime.now().strftime("%Y-%m-%d %H:%M:%S")}]\n') + except: + pass + torch.cuda.empty_cache() + progress_var.set(0) + button_widget.configure(state=tk.NORMAL) # Enable Button + return + if sf_write_err in message: text_widget.write("\n" + base_text + f'Separation failed for the following audio file:\n') text_widget.write(base_text + f'"{os.path.basename(music_file)}"\n') diff --git a/inference_v5.py b/inference_v5.py index 105d0ad..e1ee13c 100644 --- a/inference_v5.py +++ b/inference_v5.py @@ -98,6 +98,8 @@ def main(window: tk.Wm, text_widget: tk.Text, button_widget: tk.Button, progress global nn_arch_sizes global nn_architecture + #Error Handling + runtimeerr = "CUDNN error executing cudnnSetTensorNdDescriptor" cuda_err = "CUDA out of memory" mod_err = "ModuleNotFoundError" diff --git a/inference_v5_ensemble.py b/inference_v5_ensemble.py index 8f1de42..ede48d9 100644 --- a/inference_v5_ensemble.py +++ b/inference_v5_ensemble.py @@ -603,8 +603,11 @@ def main(window: tk.Wm, text_widget: tk.Text, button_widget: tk.Button, progress widget_text = text_widget gui_progress_bar = progress_var + + #Error Handling onnxmissing = "[ONNXRuntimeError] : 3 : NO_SUCHFILE" + onnxmemerror = "onnxruntime::CudaCall CUDA failure 2: out of memory" runtimeerr = "CUDNN error executing cudnnSetTensorNdDescriptor" cuda_err = "CUDA out of memory" mod_err = "ModuleNotFoundError" @@ -1975,6 +1978,30 @@ def main(window: tk.Wm, text_widget: tk.Text, button_widget: tk.Button, progress button_widget.configure(state=tk.NORMAL) # Enable Button return + if onnxmemerror in message: + text_widget.write("\n" + base_text + f'Separation failed for the following audio file:\n') + text_widget.write(base_text + f'"{os.path.basename(music_file)}"\n') + text_widget.write(f'\nError Received:\n\n') + text_widget.write(f'The application was unable to allocate enough GPU memory to use this model.\n') + text_widget.write(f'Please do the following:\n\n1. Close any GPU intensive applications.\n2. Lower the set chunk size.\n3. Then try again.\n\n') + text_widget.write(f'If the error persists, your GPU might not be supported.\n\n') + text_widget.write(f'Time Elapsed: {time.strftime("%H:%M:%S", time.gmtime(int(time.perf_counter() - stime)))}') + try: + with open('errorlog.txt', 'w') as f: + f.write(f'Last Error Received:\n\n' + + f'Error Received while processing "{os.path.basename(music_file)}":\n' + + f'Process Method: Ensemble Mode\n\n' + + f'The application was unable to allocate enough GPU memory to use this model.\n' + + f'Please do the following:\n\n1. Close any GPU intensive applications.\n2. Lower the set chunk size.\n3. Then try again.\n\n' + + f'If the error persists, your GPU might not be supported.\n\n' + + message + f'\nError Time Stamp [{datetime.now().strftime("%Y-%m-%d %H:%M:%S")}]\n') + except: + pass + torch.cuda.empty_cache() + progress_var.set(0) + button_widget.configure(state=tk.NORMAL) # Enable Button + return + if sf_write_err in message: text_widget.write("\n" + base_text + f'Separation failed for the following audio file:\n') text_widget.write(base_text + f'"{os.path.basename(music_file)}"\n')