llSourcell/AI_Composer

[Compute accuracy] TypeError: object of type 'function' has no len()

Opened this issue · 0 comments

I tried to use the accuracy function from util.py. This code is from rnn.py and it computes the accuracy on the train_data :

loss, batch_prob_train = util.run_epoch(session, data["train"]["data"], training=True, testing=True)
train_losses.append((i, loss))
train_acc = util.accuracy(batch_prob_train, data["train"]["data"])
train_acc.append((i, train_acc))

I'm getting the error :

Traceback (most recent call last):
  File "rnn.py", line 113, in <module>
    train_acc = util.accuracy(batch_prob_train, data["train"]["data"])
  File "/home/calin/BitBucket/Music-Language-Modelling/music-language-modelling/core_venv/util.py", line 265, in accuracy
    num_time_steps = len(batch_data)
TypeError: object of type 'function' has no len()