Google Colab Notebook Not Working #427

Closed
opened 2023-10-24 17:13:01 +07:00 by Ghost · 4 comments

Hey, I've previously used the google colab service to train voices before a few months ago but now when I try to set it up I get a bunch of error messages and the remote webUI doesn't even attempt to launch.

Here is the error message I get when I run the 'Running' command block.

/content/ai-voice-cloning
./start.sh: line 3: ./venv/bin/activate: No such file or directory
Traceback (most recent call last):
  File "/content/ai-voice-cloning/./src/main.py", line 11, in <module>
    from utils import *
  File "/content/ai-voice-cloning/src/utils.py", line 29, in <module>
    import torchaudio
  File "/usr/local/lib/python3.10/dist-packages/torchaudio/__init__.py", line 1, in <module>
    from . import (  # noqa: F401
  File "/usr/local/lib/python3.10/dist-packages/torchaudio/_extension/__init__.py", line 45, in <module>
    _load_lib("libtorchaudio")
  File "/usr/local/lib/python3.10/dist-packages/torchaudio/_extension/utils.py", line 64, in _load_lib
    torch.ops.load_library(path)
  File "/usr/local/lib/python3.10/dist-packages/torch/_ops.py", line 643, in load_library
    ctypes.CDLL(path)
  File "/usr/lib/python3.10/ctypes/__init__.py", line 374, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: /usr/local/lib/python3.10/dist-packages/torchaudio/lib/libtorchaudio.so: undefined symbol: _ZN3c104cuda9SetDeviceEi
./start.sh: line 5: deactivate: command not found
Hey, I've previously used the google colab service to train voices before a few months ago but now when I try to set it up I get a bunch of error messages and the remote webUI doesn't even attempt to launch. Here is the error message I get when I run the 'Running' command block. ``` /content/ai-voice-cloning ./start.sh: line 3: ./venv/bin/activate: No such file or directory Traceback (most recent call last): File "/content/ai-voice-cloning/./src/main.py", line 11, in <module> from utils import * File "/content/ai-voice-cloning/src/utils.py", line 29, in <module> import torchaudio File "/usr/local/lib/python3.10/dist-packages/torchaudio/__init__.py", line 1, in <module> from . import ( # noqa: F401 File "/usr/local/lib/python3.10/dist-packages/torchaudio/_extension/__init__.py", line 45, in <module> _load_lib("libtorchaudio") File "/usr/local/lib/python3.10/dist-packages/torchaudio/_extension/utils.py", line 64, in _load_lib torch.ops.load_library(path) File "/usr/local/lib/python3.10/dist-packages/torch/_ops.py", line 643, in load_library ctypes.CDLL(path) File "/usr/lib/python3.10/ctypes/__init__.py", line 374, in __init__ self._handle = _dlopen(self._name, mode) OSError: /usr/local/lib/python3.10/dist-packages/torchaudio/lib/libtorchaudio.so: undefined symbol: _ZN3c104cuda9SetDeviceEi ./start.sh: line 5: deactivate: command not found ```

I can't remember the exact incident, but the colab hasn't been supported in a while now, but:

OSError: /usr/local/lib/python3.10/dist-packages/torchaudio/lib/libtorchaudio.so: undefined symbol: _ZN3c104cuda9SetDeviceEi

Seeing as that error keeps cropping up, my guess is you'll need to edit the notebook file to add in explicitly installing a newer version of torch, rather than the default one from PyPI.

Example: pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118

And I suppose from ./start.sh: line 5: deactivate: command not found, the venv isn't being created / respected, so I'm assuming it's trying to leverage the default PyTorch installation from the colab space.

I can't remember the exact incident, but the colab hasn't been supported in a while now, but: > `OSError: /usr/local/lib/python3.10/dist-packages/torchaudio/lib/libtorchaudio.so: undefined symbol: _ZN3c104cuda9SetDeviceEi` Seeing as that error keeps cropping up, my guess is you'll need to edit the notebook file to add in explicitly installing a newer version of torch, rather than the default one from PyPI. Example: `pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118` And I suppose from `./start.sh: line 5: deactivate: command not found`, the venv isn't being created / respected, so I'm assuming it's trying to leverage the default PyTorch installation from the colab space.

Oh right, that's sad to hear. I'm a 3D designer and not a programmer lol so I'm not sure how I would edit the notebook to make it work properly, would I have to update the commands in the repo files or just run the commands inside the colab?

Thanks for the reply and thanks for the scripts, I'm still able to train on my own computer locally and it works great.

Oh right, that's sad to hear. I'm a 3D designer and not a programmer lol so I'm not sure how I would edit the notebook to make it work properly, would I have to update the commands in the repo files or just run the commands inside the colab? Thanks for the reply and thanks for the scripts, I'm still able to train on my own computer locally and it works great.

I'm not sure how I would edit the notebook to make it work properly, would I have to update the commands in the repo files or just run the commands inside the colab?

If I recall right, there isn't a terminal to run commands in (where P*p*rsp*c* does but not for the free tier) is a terminal, however it requires Colab Pro. Instead, you can edit the colab notebook by clicking a code block and pasting the code in it, then running it. So this block:

!apt install python3.8-venv
!git clone https://git.ecker.tech/mrq/ai-voice-cloning/
%cd /content/ai-voice-cloning
!./setup-cuda.sh

can be:

!apt install python3.10-venv
!git clone https://git.ecker.tech/mrq/ai-voice-cloning/
%cd /content/ai-voice-cloning
!./setup-cuda.sh
!source ./venv/bin/activate
!pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118

I'm currently validating the notebook on my end and seeing if it the venv just needs to be updated to use python3.10 (since I'm assuming the Colab base image finally updated to use it). If it works out fine, I'll update the colab notebook file.


Nevermind, I should have the colab notebook updated to be fixed.

> I'm not sure how I would edit the notebook to make it work properly, would I have to update the commands in the repo files or just run the commands inside the colab? If I recall right, there ~~isn't a terminal to run commands in (where P\*p\*rsp\*c\* does but not for the free tier)~~ is a terminal, however it requires Colab Pro. Instead, you can edit the colab notebook by clicking a code block and pasting the code in it, then running it. So this block: ``` !apt install python3.8-venv !git clone https://git.ecker.tech/mrq/ai-voice-cloning/ %cd /content/ai-voice-cloning !./setup-cuda.sh ``` can be: ``` !apt install python3.10-venv !git clone https://git.ecker.tech/mrq/ai-voice-cloning/ %cd /content/ai-voice-cloning !./setup-cuda.sh !source ./venv/bin/activate !pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118 ``` I'm currently validating the notebook on my end and seeing if it the venv just needs to be updated to use python3.10 (since I'm assuming the Colab base image finally updated to use it). If it works out fine, I'll update the colab notebook file. --- Nevermind, I should have the colab notebook updated to be fixed.

It seems to be working again, thank you so much, I'll be sure to give you credit if I ever use these voices in anything I produce.

It seems to be working again, thank you so much, I'll be sure to give you credit if I ever use these voices in anything I produce.
Ghost closed this issue 2023-10-26 20:26:17 +07:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: mrq/ai-voice-cloning#427
There is no content yet.