Comments (3)
I was able to do this by making a Docker image that is close to the Google Colab environment.
Maybe start with:
FROM ubuntu:18.04
RUN apt-get update && apt-get install -y libssl-dev openssl wget build-essential zlib1g-dev git libfluidsynth1 libasound2-dev libjack-dev libffi-dev libbz2-dev liblzma-dev libsqlite3-dev
Then install python 3.7.13, install t5x, mt3, create an infer.py
script or however you want to do it. You can use the colab to find gin files as well: ismir2021.gin
mt3.gin
model.gin
, then checkpoint files, sf2 file.
When it doubt, just refer back to their colab code: https://github.com/magenta/mt3/blob/main/mt3/colab/music_transcription_with_transformers.ipynb and translate it to your setup.
It's a lot. There's probably better ways to do this but this was the only way I could make it happen. Maybe someone from Magenta will respond with a better way. Good luck!
EDIT for GPU:
follow instructions for setting up cuda
https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html
install cuda-toolkit
install cuda drivers
and then cudnn (basically from: https://github.com/google/jax)
You need to make sure everything is compatible (i.e. toolkit version is compatible with driver, also compatible with the correct jax/jaxlib version on the image)
I had issues because I my server/box is ubuntu22.04 and cudnn doesn't have a nice installer for that yet
but I found this amazingly helpful video: https://www.youtube.com/watch?v=4LvgOmxugFU
Also had issues with the docker container being able to run ptxas (which apparently tf needs), so I ended up using devel
version
(FROM nvidia/cuda:11.7.0-devel-ubuntu18.04
)
google/jax#6843 (comment)
There's probably a more correct way however.
I finally got it working with my 1050ti (very weak GPU) -- but my quick test still went about 5x faster than CPU.
from mt3.
@jsphweid How long did you use the 1050ti? Recently, it takes nearly 20 minutes to use google colab (gpu mode). What I am talking about here is the time it takes to process the next step after uploading the file. In the past, at most 5 minutes. I don't know if it's because of google colab or something else?
from mt3.
@yueyin85 ya I don't know why colab would take longer than that considering the cards that it uses (make sure GPU/TPU is selected?). For the 1050ti, it takes at least a few minutes. I recently ran 4000 files through it and it ran for a week straight getting most of the way through before I upgraded to a 3090.
Also I put together this docker image that runs mt3 with nvidia gpu via a little flask server:
https://github.com/jsphweid/mt3-docker
3090 takes less than a minute for pure inference (calls to model/gpu) most of the time. Pre/Post processing take under a second. Only really works 1 request at a time though. There's probably lots that could be done. Still much easier to a batch of files compared to colab though.
from mt3.
Related Issues (20)
- Error 'name 'serialization' is not defined' HOT 1
- No module named 'jax.experimental.gda_serialization' HOT 4
- Google Colab Notebook says its not using the GPU HOT 3
- Maximum call stack size exceeded in upload_audio
- colab is not working anymore HOT 26
- ERRοΌ HOT 1
- some question when represent midi as sheet music in piano transcription
- ImportError HOT 6
- Error reported when running Imports and Definitions
- CPU Execution HOT 4
- HOW TO SAVE A MODEL?
- Training & Finetuning HOT 1
- error when running the "Transcribe Audio" stage HOT 3
- CUDA backend failed to initialize HOT 2
- Evaluation codes
- Colab not longer workin HOT 4
- failed to run Transcribe Audio in colab HOT 1
- colab: Upload Audio: MessageError: RangeError: Maximum call stack size exceeded.
- Error when transcribing audio in google colab HOT 3
- Colab: When Imports and Definitions Failed HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mt3.