Bihaqo / t3f

Tensor Train decomposition on TensorFlow
https://t3f.readthedocs.io/en/latest/index.html
MIT License
218 stars 56 forks source link

TypeError: unhashable type: 'list' #183

Closed yiulau closed 4 years ago

yiulau commented 4 years ago

When I run


import numpy as np
import tensorflow as tf
tf.enable_eager_execution()
import t3f

a_dense = np.random.rand(8, 27).astype(np.float32)
a_matrix_tt = t3f.to_tt_matrix(a_dense, shape=((2, 2, 2), (3, 3, 3)), max_tt_rank=4)

I got this error:

Traceback (most recent call last):
  File "test.py", line 7, in <module>
    a_matrix_tt = t3f.to_tt_matrix(a_dense, shape=((2, 2, 2), (3, 3, 3)), max_tt_rank=4)
  File "/home/yiu/anaconda3/envs/tf112/lib/python3.6/site-packages/t3f/decompositions.py", line 77, in to_tt_matrix
    tt_tens = to_tt_tensor(tens, max_tt_rank, epsilon)
  File "/home/yiu/anaconda3/envs/tf112/lib/python3.6/site-packages/t3f/decompositions.py", line 187, in to_tt_tensor
    return TensorTrain(tt_cores, static_shape, ranks)
  File "/home/yiu/anaconda3/envs/tf112/lib/python3.6/site-packages/t3f/tensor_train.py", line 54, in __init__
    with tf.name_scope("TensorTrain", tt_cores):
  File "/home/yiu/anaconda3/envs/tf112/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 5998, in __enter__
    if cache_key in name_scope_cache:
TypeError: unhashable type: 'list'

I have tensorflow 1.12 and python 3.6

Bihaqo commented 4 years ago

Hi, thanks for creating the issue. I tried to reproduce it here, but it seems to work normally: https://colab.research.google.com/drive/1c8Km3-F5bb4XoXtqVvMVIJZdqnDvN8QC

Do you know how to change this example to make it fail?

Bihaqo commented 4 years ago

Closing for now, feel free to reopen if the issue is still there.