Bihaqo / t3f

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

example in quick start not working #215

Closed rkuoyemnbeek closed 3 years ago

rkuoyemnbeek commented 3 years ago

Hi,

I am interested to use TT in my research. I used to work in Matlab but now I start using python. The first example in the quick start (see https://t3f.readthedocs.io/en/latest/quick_start.html) seems not to work on my laptop. I use a Windows and use Python 3.6.10 and tensorflow version 2.4.0.

`import numpy as np

import tensorflow as tf

import t3f

a_dense = np.random.randn(3, 4)

a_tt = t3f.to_tt_tensor(a_dense)

reconstructed_matrix = t3f.full(a_tt) `

The error I get is: ` a_tt = t3f.to_tt_tensor(a_dense)

File "C:\Users\koenr\anaconda3\envs\py36\lib\site-packages\t3f\decompositions.py", line 140, in to_tt_tensor with tf.name_scope(name, values=(tens,)):

TypeError: init() got an unexpected keyword argument 'values'`

SaeedPourjafar commented 3 years ago

I'm in the same situation when I run it on my local computer in jupyter notebook. However when I use Google colab notebook, it runs without any error. I checked my installed version of TensorFlow and t3f on both colab and my local computer. They were the same (tensorflow 2.5.0rc0, t3f 1.1.0) I'd be appreciate it if someone can help us on this.

Bihaqo commented 3 years ago

Hi, sorry for a really long reply. I fixed this problem on github sometime ago, but I haven't update the pip version yet.

You can install the github version by doing

git clone https://github.com/Bihaqo/t3f.git
cd t3f
pip install .

I'll push a new version to pip later in the evening, after that you can just do pip install t3f -U instead.

Bihaqo commented 3 years ago

Done