bstriner / bstriner/dense_tensor
ValueError: Multiple target dimensions are not supported. Expected: None, int, (int, int), Provided: [[1], [1]]
- Dominant language
- Python
- Stars
- 8
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
I just ran the "examples/example_tensor.py" and got an error
`ValueError: Multiple target dimensions are not supported. Expected: None, int, (int, int), Provided: [[1], [1]]`
I use Kera 2.2.2 and tensorflow 1.9.0.
Could you help me to check this problem?
```
# example code
from keras.layers import Input
from keras.models import Model
from keras.optimizers import Adam
from dense_tensor import DenseTensor, simple_tensor_factorization
from dense_tensor.example_utils import experiment
from dense_tensor.utils import l1l2
def tensor_model(input_dim=28 * 28, output_dim=10, reg=lambda: l1l2(1e-6, 1e-6)):
"""
One layer of a DenseTensor
"""
_x = Input(shape=(input_dim,))
factorization = simple_tensor_factorization(tensor_regularizer=reg())
y = DenseTensor(units=output_dim,
activation='softmax',
kernel_regularizer=reg(),
factorization=factorization)
_y = y(_x)
m = Model(_x, _y)
m.compile(Adam(1e-3, decay=1e-4), loss='categorical_crossentropy', metrics=["accuracy"])
return m
if __name__ == "__main__":
path = "output/dense_tensor"
model = tensor_model()
experiment(path, model)
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with examples/example_tensor.py and trace tensor_model() into experiment() to reproduce the ValueError using the reported Keras 2.2.2 and TensorFlow 1.9.0 versions. Compare the target dimensions passed through the example and DenseTensor, then verify that the example runs without the reported error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- keras, python, tensorflow
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100