Comments (6)
Hi, it does seem that the reason it would take so long is running on CPU. You might want to confirm that your tensorflow is able to run on the GPU on your machine outside of the script. The long files however is very strange. @JCBrouwer do you have any thoughts on what could be going on?
from magenta-demos.
Thanks @jesseengel . It did seem that GPU was available from tf.test.is_gpu_available, but I'll give it a more thorough check by running some model then.
Maybe relevant: There were some errors with generate.py code in general. np.linspace kept throwing errors about the third np.linspace argument having to be an integer (it was a float). (maybe a numpy / python version issue? I use numpy 1.18.4 and python 3.6). Temporarily silenced it by rounding to int with np.int(), but might indicate that the cause of long length files is a similar issue? I tried on ubuntu and windows and both needed that modification
from magenta-demos.
I was able to reproduce the issue as well, but also managed to get it working correctly.
The issue for me was indeed related to executing on the CPU. To get it working I uninstalled magenta and made sure only magenta-gpu was installed. Also, my tf.test.is_gpu_available() showed an error because cudnn wasn't installed. This is super easy to install if you use anaconda, just a "conda install cudnn" was enough.
The 30 minute wavs are related to the way the files are slowly being filled in 10000 samples at a time by nsynth_generate. I think it's just the metadata of the half-finished audio being incorrect. Once they're completely done rendering it should show them as the correct length.
A good way to test whether you're running on the GPU correctly is to run the nsynth_generate command manually (generate.py is running this under the hood for you):
nsynth_generate \
--checkpoint_path=/home/hans//code/magenta/magenta/models/nsynth/wavenet/wavenet-ckpt/model.ckpt-200000 \
--source_path=/home/hans/code/magenta-demos/nsynth/working_dir/embeddings/interp/batch0 \
--save_path=/home/hans/code/magenta-demos/nsynth/working_dir/audio/batch0 \
--sample_length=80000 \
--batch_size=256 \
--log=DEBUG \
--gpu_number=0
(you'll have to edit the paths to match your own)
On my 1080 Ti I'm generating around 100 samples per second while on the CPU it was taking a LOT longer. While it's running you can take a look in htop & nvtop to see what's being used.
BTW, I also ran into the float error in the np.linspace and just casting the third argument is fine. I think as long as the second one isn't cast it shouldn't break anything (I believe it needed to be a float to prevent some off by one errors related to audio file placement in multigrids).
from magenta-demos.
OK scratch the part about the long files. The run I left on overnight is still generating. For some reason it isn't stopping after it has generated sample_length samples. The first 5 seconds (ie 80000 samples) of audio sound correct, but the files are still 43 minutes long.
I can take a better look through generate.py over the next couple days, but I feel like this might be something in nsynth_generate.
Do embeddings of length 156 sound about right for 5 sec of audio @jesseengel ?
from magenta-demos.
@JCBrouwer Thank you, I'll make sure to fix my GPU problem first, and for the time being I'll manually end the generation when I hit 4 seconds sample length
from magenta-demos.
Thanks for following up on this @JCBrouwer. If I recall correctly embeddings should be every 32ms, so 156 sounds right I think.
from magenta-demos.
Related Issues (20)
- Magenta demos not working as `!pip install magenta` fails on Colab
- Are you planning on making a version for Logic Pro X? HOT 1
- Trained models for Chair HOT 1
- Python way of loading model HOT 4
- How to save sketches drawn in Sketch-RNN? HOT 1
- Image Stylization jupyter book doesn't work on Windows HOT 1
- style transfer demo broken on colab
- Image Stylization notebook doesn't work on Colab HOT 1
- Error with Placeholder_1 in sketch RNN
- How to do the midi generation and midi playing simultaneously? HOT 2
- Unable to load cat.gen.js and firetruck.gen.js
- Setting the environment to run the Sketch_RNN.ipynb
- Will NSynth support the VST/AU format as an audio/MIDI plug-in in the future? HOT 1
- has multigrid generation been removed for the NSYNTH? HOT 1
- Nsynth generate.py "operands could not be broadcast together with shapes" HOT 1
- Nsynth generate.py "TypeError: 'float' object cannot be interpreted as an integer" with numpy 1.18.4 HOT 3
- Getting Black Images as Output for Image Stylization
- Google Colaboratory Notebook Examples Broken HOT 1
- Broken links in hello-magenta.glitch.me
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 magenta-demos.