1
0

explicitly use python3 because some OSs will not have python alias to python3, allow batch size 1

This commit is contained in:
mrq 2023-02-21 20:20:52 +00:00
parent 8a1a48f31e
commit f119993fb5
4 changed files with 26 additions and 22 deletions

View File

@ -2,12 +2,13 @@
git submodule init
git submodule update
python -m venv venv
python3 -m venv venv
source ./venv/bin/activate
python -m pip install --upgrade pip
python3 -m pip install --upgrade pip
# CUDA
pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu116
python -m pip install -r ./dlas/requirements.txt
python -m pip install -r ./tortoise-tts/requirements.txt
python -m pip install -r ./requirements.txt
python -m pip install -e ./tortoise-tts/
python3 -m pip install -r ./dlas/requirements.txt
python3 -m pip install -r ./tortoise-tts/requirements.txt
python3 -m pip install -r ./requirements.txt
python3 -m pip install -e ./tortoise-tts/
deactivate

View File

@ -2,13 +2,13 @@
git submodule init
git submodule update
python -m venv venv
python3 -m venv venv
source ./venv/bin/activate
python -m pip install --upgrade pip
python3 -m pip install --upgrade pip
# ROCM
pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/rocm5.1.1 # 5.2 does not work for me desu
python -m pip install -r ./dlas/requirements.txt
python -m pip install -r ./tortoise-tts/requirements.txt
python -m pip install -r ./requirements.txt
python -m pip install -e ./tortoise-tts/
python3 -m pip install -r ./dlas/requirements.txt
python3 -m pip install -r ./tortoise-tts/requirements.txt
python3 -m pip install -r ./requirements.txt
python3 -m pip install -e ./tortoise-tts/
deactivate

View File

@ -575,14 +575,17 @@ def optimize_training_settings( epochs, batch_size, learning_rate, learning_rate
batch_size = lines
messages.append(f"Batch size is larger than your dataset, clamping batch size to: {batch_size}")
if batch_size / mega_batch_factor < 2:
mega_batch_factor = int(batch_size / 2)
messages.append(f"Mega batch factor is too large for the given batch size, clamping mega batch factor to: {mega_batch_factor}")
if batch_size % lines != 0:
nearest_slice = int(lines / batch_size) + 1
batch_size = int(lines / nearest_slice)
messages.append(f"Batch size not neatly divisible by dataset size, adjusting batch size to: {batch_size} ({nearest_slice} steps per epoch)")
if batch_size == 1 and mega_batch_factor != 1:
mega_batch_factor = 1
messages.append(f"Mega batch factor is too large for the given batch size, clamping mega batch factor to: {mega_batch_factor}")
elif batch_size / mega_batch_factor < 2:
mega_batch_factor = int(batch_size / 2)
messages.append(f"Mega batch factor is too large for the given batch size, clamping mega batch factor to: {mega_batch_factor}")
iterations = calc_iterations(epochs=epochs, lines=lines, batch_size=batch_size)

View File

@ -2,14 +2,14 @@
git pull
git submodule update
python -m venv venv
python3 -m venv venv
source ./venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -r ./dlas/requirements.txt
python -m pip install -r ./tortoise-tts/requirements.txt
python -m pip install -e ./tortoise-tts
python -m pip install -r ./requirements.txt
python3 -m pip install --upgrade pip
python3 -m pip install -r ./dlas/requirements.txt
python3 -m pip install -r ./tortoise-tts/requirements.txt
python3 -m pip install -e ./tortoise-tts
python3 -m pip install -r ./requirements.txt
deactivate