Comments (5)
Sorry, but I can't reproduce the TypeError: iteration over a 0-d tensor
error. What version of PyTorch are you using? I'm using version 0.3 (because newer versions don't have support for my GPU), so there may be a problem with backward compatibility? Anyway you should always specify a primer when generating.
from generating-music.
Thanks for raising this issue, I have noticed some files were missing. Please try to run the program with an argument "--primer piano.mus", does it work now?
from generating-music.
This is a great code, can you provide more details about training data and test data? It is currently not working
from generating-music.
C:\Users\caocao\Anaconda3\python.exe "D:/work/work11/generating-music-master/Generative Model/Chord_Predictor/chord_generate.py" --cuda True
C:\Users\caocao\Anaconda3\lib\site-packages\torch\serialization.py:367: SourceChangeWarning: source code of class 'torch.nn.modules.dropout.Dropout' has changed. you can retrieve the original source code by accessing the object's source attribute or set torch.nn.Module.dump_patches = True
and use the patch tool to revert the changes.
warnings.warn(msg, SourceChangeWarning)
C:\Users\caocao\Anaconda3\lib\site-packages\torch\serialization.py:367: SourceChangeWarning: source code of class 'torch.nn.modules.sparse.Embedding' has changed. you can retrieve the original source code by accessing the object's source attribute or set torch.nn.Module.dump_patches = True
and use the patch tool to revert the changes.
warnings.warn(msg, SourceChangeWarning)
C:\Users\caocao\Anaconda3\lib\site-packages\torch\serialization.py:367: SourceChangeWarning: source code of class 'torch.nn.modules.linear.Linear' has changed. you can retrieve the original source code by accessing the object's source attribute or set torch.nn.Module.dump_patches = True
and use the patch tool to revert the changes.
warnings.warn(msg, SourceChangeWarning)
..\Chord_Predictor\lstm_model.py:51: UserWarning: nn.init.xavier_uniform is now deprecated in favor of nn.init.xavier_uniform_.
self.hidden = (Variable(nn.init.xavier_uniform(weight.new(self.n_layers, batch_size, self.hidden_size))),
..\Chord_Predictor\lstm_model.py:52: UserWarning: nn.init.xavier_uniform is now deprecated in favor of nn.init.xavier_uniform_.
Variable(nn.init.xavier_uniform(weight.new(self.n_layers, batch_size, self.hidden_size))))
Traceback (most recent call last):
File "D:/work/work11/generating-music-master/Generative Model/Chord_Predictor/chord_generate.py", line 84, in
output = generate_chords(args.model, args.primer, args.cuda, args.priming_length, args.length, args.temperature, args.n_primes)
File "D:/work/work11/generating-music-master/Generative Model/Chord_Predictor/chord_generate.py", line 34, in generate_chords
model.repackage_hidden()
File "..\Chord_Predictor\lstm_model.py", line 70, in repackage_hidden
self.__repackage_hidden(self.hidden)
File "..\Chord_Predictor\lstm_model.py", line 67, in __repackage_hidden
return tuple(self.__repackage_hidden(v) for v in h)
File "..\Chord_Predictor\lstm_model.py", line 67, in
return tuple(self.__repackage_hidden(v) for v in h)
File "..\Chord_Predictor\lstm_model.py", line 67, in __repackage_hidden
return tuple(self.__repackage_hidden(v) for v in h)
File "..\Chord_Predictor\lstm_model.py", line 67, in
return tuple(self.__repackage_hidden(v) for v in h)
File "..\Chord_Predictor\lstm_model.py", line 67, in __repackage_hidden
return tuple(self.__repackage_hidden(v) for v in h)
File "..\Chord_Predictor\lstm_model.py", line 67, in
return tuple(self.__repackage_hidden(v) for v in h)
File "..\Chord_Predictor\lstm_model.py", line 67, in __repackage_hidden
return tuple(self.__repackage_hidden(v) for v in h)
File "..\Chord_Predictor\lstm_model.py", line 67, in
return tuple(self.__repackage_hidden(v) for v in h)
File "..\Chord_Predictor\lstm_model.py", line 67, in __repackage_hidden
return tuple(self.__repackage_hidden(v) for v in h)
File "C:\Users\caocao\Anaconda3\lib\site-packages\torch\tensor.py", line 360, in iter
raise TypeError('iteration over a 0-d tensor')
TypeError: iteration over a 0-d tensor
from generating-music.
There are currently no training data, as they were quite large to be included. The idea is that you should use Analyzer and its "Convert Batch" button to transform your own MIDI dataset into the .mus format used by the generative model.
But I see that it's an unnecessarily difficult process if you just want to give it a try -- that's why I've added a small dataset of Beatles songs to the Data directory, so you can try to train a new model :) (don't expect miracles from such a small dataset, but I hope it won't at least throw an exception).
For example try to run music_train.py
with --train_file beatles_batch.mus --val_file beatles_batch.mus --event_emsize 64 --nhid 64 --seq_len 64 --layers 2 --batch_size 64
from generating-music.
Related Issues (1)
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 generating-music.