sephora-m / chord2vec Goto Github PK
View Code? Open in Web Editor NEWFrom word2vec to chord2vec tensorFlow implementation
From word2vec to chord2vec tensorFlow implementation
rnn.rnn is used in https://github.com/Sephora-M/chord2vec/blob/master/chord2vec/seq2seq/seq2seqs_model.py#L441
but according to
tensorflow/tensorflow#8836
I should either use dynamic_rnn, that matches the signature of the function
or raw_rnn which doesn't. I tried using dynamic_rnn and ran into the
following error:
File "/some/path/local/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 44, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "main.py", line 710, in main
train()
File "main.py", line 380, in train
model = create_seq2seqs_model(sess, False)
File "main.py", line 282, in create_seq2seqs_model
FLAGS.learning_rate_decay_factor)
File "/some/path/repo/chord2vec/chord2vec/seq2seq/seq2seqs_model.py", line 100, in __init__
buckets, lambda x,y: embedding_rnn_seq2seqs(x,num_decoders,y,cell,
File "/some/path/repo/chord2vec/chord2vec/seq2seq/seq2seqs_model.py", line 563, in model_with_buckets
decoders_inputs)
File "/some/path/repo/chord2vec/chord2vec/seq2seq/seq2seqs_model.py", line 102, in <lambda>
embedding_size=num_units))
File "/some/path/repo/chord2vec/chord2vec/seq2seq/seq2seqs_model.py", line 441, in embedding_rnn_seq2seqs
_, encoder_state = rnn.dynamic_rnn(encoder_cell, encoder_inputs, dtype=dtype)
File "/some/path/local/lib/python2.7/site-packages/tensorflow/python/ops/rnn.py", line 489, in dynamic_rnn
for input_ in flat_input)
File "/some/path/local/lib/python2.7/site-packages/tensorflow/python/ops/rnn.py", line 489, in <genexpr>
for input_ in flat_input)
File "/some/path/local/lib/python2.7/site-packages/tensorflow/python/ops/array_ops.py", line 1288, in transpose
ret = gen_array_ops.transpose(a, perm, name=name)
File "/some/path/local/lib/python2.7/site-packages/tensorflow/python/ops/gen_array_ops.py", line 3841, in transpose
result = _op_def_lib.apply_op("Transpose", x=x, perm=perm, name=name)
File "/some/path/local/lib/python2.7/site-packages/tensorflow/python/framework/op_def_library.py", line 763, in apply_op
op_def=op_def)
File "/some/path/local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2397, in create_op
set_shapes_for_outputs(ret)
File "/some/path/local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 1757, in set_shapes_for_outputs
shapes = shape_func(op)
File "/some/path/local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 1707, in call_with_requiring
return call_cpp_shape_fn(op, require_shape_fn=True)
File "/some/path/local/lib/python2.7/site-packages/tensorflow/python/framework/common_shapes.py", line 610, in call_cpp_shape_fn
debug_python_shape_fn, require_shape_fn)
File "/some/path/local/lib/python2.7/site-packages/tensorflow/python/framework/common_shapes.py", line 675, in _call_cpp_shape_fn_impl
raise ValueError(err.message)
ValueError: Dimension must be 1 but is 3 for 'model/model_with_buckets/model/embedding_rnn_seq2seq/transpose' (op: 'Transpose') with input shapes: [?], [3].
could you guide me what's the intended use for the rnn?
I can't seem to import this package, it depends on tensorflow.models.rnn.translate which doesn't seem to be a part standard tensorflow, what is required to make this work?
In [5]: import chord2vec
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-5-79c3668bd7a5> in <module>()
----> 1 import chord2vec
.../local/lib/python2.7/site-packages/chord2vec/__init__.py in <module>()
----> 1 from seq2seq_model import Seq2SeqModel
2 from seq2seqs_model import Seq2SeqsModel
.../local/lib/python2.7/site-packages/chord2vec/seq2seq_model.py in <module>()
26 import tensorflow as tf
27
---> 28 from tensorflow.models.rnn.translate import data_utils
29
30
ImportError: No module named models.rnn.translate
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.