From 4edeef7e05c9c6b33012310ef6c8f71079a8e017 Mon Sep 17 00:00:00 2001 From: Ben Arthur Date: Tue, 24 Sep 2024 10:27:21 -0400 Subject: [PATCH] fix windows install --- README.md | 3 ++- app/DROP-FILES-HERE.bat | 2 +- app/make-predictions.py | 7 ++++--- install/conda/songexplorer/meta.yaml | 8 ++++---- src/activations | 8 ++++---- src/classify | 11 ++++++----- 6 files changed, 21 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index ddf21da..5bbb93f 100755 --- a/README.md +++ b/README.md @@ -366,6 +366,7 @@ privileges: > $tbpath="" > [Environment]::SetEnvironmentVariable("SONGEXPLORER_BIN", $tbpath + ";" + + $tbpath + "\bin\songexplorer\src;" + $tbpath + "\Library\mingw-w64\bin;" + $tbpath + "\Library\usr\bin;" + $tbpath + "\Library\bin;" + @@ -1925,7 +1926,7 @@ Then build: To install directly from this local build: $ conda create --name songexplorer - $ conda install -n songexplorer --use-local songexplorer -c conda-forge + $ conda install -n songexplorer --use-local songexplorer -c conda-forge -c nvidia Pay attention to the notice at the end demarcated with "*** IMPORTANT !!! ***". Follow the directions therein to install platform-specific diff --git a/app/DROP-FILES-HERE.bat b/app/DROP-FILES-HERE.bat index 0959574..2f0a1a4 100755 --- a/app/DROP-FILES-HERE.bat +++ b/app/DROP-FILES-HERE.bat @@ -2,7 +2,7 @@ setlocal set tbpath=%~dp0\songexplorer -SET PATH=%tbpath%;%tbpath%\Library\mingw-w64\bin;%tbpath%\Library\usr\bin;%tbpath%\Library\bin;%tbpath%\Scripts;%tbpath%\bin;%PATH% +SET PATH=%tbpath%;%tbpath%\bin\songexplorer\src;%tbpath%\Library\mingw-w64\bin;%tbpath%\Library\usr\bin;%tbpath%\Library\bin;%tbpath%\Scripts;%tbpath%\bin;%PATH% python.exe %~dp0\make-predictions.py %* diff --git a/app/make-predictions.py b/app/make-predictions.py index 7d297db..efed4d4 100755 --- a/app/make-predictions.py +++ b/app/make-predictions.py @@ -18,13 +18,14 @@ use_aitch = True +_, *wavpaths = sys.argv +print("wavepaths = ", *wavpaths) + __dir__ = os.path.dirname(__file__) sys.path.append(os.path.join(__dir__, "songexplorer", "bin", "songexplorer", "test")) from libtest import wait_for_job -_, *wavpaths = sys.argv - sys.path.append(os.path.join(__dir__, "songexplorer", "bin", "songexplorer", "src", "gui")) import model as M import view as V @@ -75,7 +76,7 @@ def do_it(wavfile): V.waitfor.active = True asyncio.run(C.ethogram_actuate()) - logfile = wavfile+"-post-process.log" + logfile = M.trim_ext(wavfile)+"-post-process.log" ncpu_cores, ngpu_cards, ngigabyes_memory = 1, 0, 8 localdeps = ["-d "+M.waitfor_job.pop()] kwargs = {"process_group": 0} if sys.version_info.major == 3 and sys.version_info.minor >= 11 else {} diff --git a/install/conda/songexplorer/meta.yaml b/install/conda/songexplorer/meta.yaml index b5ed7b7..ba6cfd8 100644 --- a/install/conda/songexplorer/meta.yaml +++ b/install/conda/songexplorer/meta.yaml @@ -14,11 +14,11 @@ build: requirements: run: - python <=3.10 - - numpy + - numpy <2 - tensorflow >=2.8,<2.14 # [linux] - - cudatoolkit # [win] - - cudnn # [win] - - cuda-nvcc # [win] + - cudatoolkit=11 # [win] + - cudnn=8 # [win] + - cuda-nvcc=12 # [win] - bokeh >=2,<3 - matplotlib-base - natsort diff --git a/src/activations b/src/activations index f54fb6e..609657d 100755 --- a/src/activations +++ b/src/activations @@ -75,6 +75,10 @@ from lib import log_nvidia_smi_output, select_GPUs FLAGS = None def main(): + flags = vars(FLAGS) + for key in sorted(flags.keys()): + print('%s = %s' % (key, flags[key])) + os.environ['TF_DETERMINISTIC_OPS']=FLAGS.deterministic os.environ['TF_DISABLE_SPARSE_SOFTMAX_XENT_WITH_LOGITS_OP_DETERMINISM_EXCEPTIONS']=FLAGS.deterministic if FLAGS.deterministic: @@ -88,10 +92,6 @@ def main(): sys.path.append(os.path.dirname(FLAGS.video_findfile)) video_findfile = importlib.import_module(os.path.basename(FLAGS.video_findfile)).video_findfile - flags = vars(FLAGS) - for key in sorted(flags.keys()): - print('%s = %s' % (key, flags[key])) - audio_read_plugin_kwargs = eval(FLAGS.audio_read_plugin_kwargs) video_read_plugin_kwargs = eval(FLAGS.video_read_plugin_kwargs) diff --git a/src/classify b/src/classify index 0269455..4905fd3 100755 --- a/src/classify +++ b/src/classify @@ -65,6 +65,12 @@ from lib import compute_background FLAGS = None def main(): + flags = vars(FLAGS) + for key in sorted(flags.keys()): + print('%s = %s' % (key, flags[key])) + + audio_tic_rate = FLAGS.audio_tic_rate + os.environ['TF_DETERMINISTIC_OPS']=FLAGS.deterministic os.environ['TF_DISABLE_SPARSE_SOFTMAX_XENT_WITH_LOGITS_OP_DETERMINISM_EXCEPTIONS']=FLAGS.deterministic @@ -87,11 +93,6 @@ def main(): return video_read_module.video_read(fullpath, start_frame, stop_frame, **FLAGS.video_read_plugin_kwargs) - audio_tic_rate = FLAGS.audio_tic_rate - - print('model = '+str(FLAGS.model)) - print('audio_tic_rate = '+str(audio_tic_rate)) - with open(FLAGS.model_labels, 'r') as fid: model_labels = fid.read().splitlines()