Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'tensor' object has no attribute 'broadcastable' #9

Open
tansinjahan opened this issue Nov 23, 2017 · 5 comments
Open

Comments

@tansinjahan
Copy link

I am getting this error while running VaDE.py in windows. Can you please suggest how to solve the problem?

C:\Users\GIGL\VaDE-master>python VaDE.py dataset
Using TensorFlow backend.
WARNING (theano.configdefaults): g++ not available, if using conda: conda insta ll m2w64-toolchain
C:\Program Files\Python35\lib\site-packages\theano\configdefaults.py:560: UserWa
rning: DeprecationWarning: there is no c++ compiler.This is deprecated and with
Theano 0.11 a c++ compiler will be mandatory
warnings.warn("DeprecationWarning: there is no c++ compiler."
WARNING (theano.configdefaults): g++ not detected ! Theano will be unable to exe
cute optimized C-implementations (for both CPU and GPU) and will default to Pyth
on implementations. Performance will be severely degraded. To remove this warnin
g, set Theano flags cxx to an empty string.
WARNING (theano.tensor.blas): Using NumPy C-API based implementation for BLAS fu
nctions.
training on: mnist
Traceback (most recent call last):
File "VaDE.py", line 249, in
Gamma = Lambda(get_gamma, output_shape=(n_centroid,))(z)
File "C:\Program Files\Python35\lib\site-packages\keras\engine\topology.py", l
ine 603, in call
output = self.call(inputs, **kwargs)
File "C:\Program Files\Python35\lib\site-packages\keras\layers\core.py", line
651, in call
return self.function(inputs, **arguments)
File "VaDE.py", line 111, in get_gamma
temp_Z=T.transpose(K.repeat(tempz,n_centroid),[0,2,1])
File "C:\Program Files\Python35\lib\site-packages\theano\tensor\basic.py", lin
e 3691, in transpose
ret = DimShuffle(x.broadcastable, axes)(x)
AttributeError: 'Tensor' object has no attribute 'broadcastable'

@isamu
Copy link

isamu commented Feb 14, 2018

When I using TensorFlow backend, I got similar error.
Try to change keras backend to theano.

@JasonKwok17
Copy link

@tansinjahan ,I have the same problem as you,and @isamu I did as he said,change keras backend from TensorFlow to Theano,I dont have this error now,but I have another error!
image
please help me,thanks lot!

@isamu
Copy link

isamu commented Mar 7, 2018

@JasonKwok17 Are you using correct versions?
Python-3.4.4
keras-1.1.0
scikit-learn-1.17.1

When I was using different versions, I got same error. Please comfirm those.

To install those, I used pyenv and pip-sync, then I get valid version environment.
Please check my PR #12

pyenv install 3.4.4
pyenv virtualenv 3.4.4 VaDE
pyenv local VaDE
pip install pip-tools
pip-sync requirements/*.txt

@ReyhanehAbbasi
Copy link

Dear @isamu I had some troubles installing python throguh pyenv:
`ERROR: The Python ssl extension was not compiled. Missing the OpenSSL lib?

Please consult to the Wiki page to fix the problem.
https://github.com/pyenv/pyenv/wiki/Common-build-problems
`
I also tried to install python3.4.4, using this instruction but there is a problem with installing packages. because every package I install, it can be imported on python 3.5 (which was on our server initially). do you any other solutions for solving this issue?
Using the above-mentioned version of python and modules, could you use VaDE for your data?
Please consider that I am not root!

@isamu
Copy link

isamu commented Mar 21, 2018

@Roabb as https://github.com/pyenv/pyenv/wiki/Common-build-problems, you should like to set CFLAGS and LDFLAGS when you install pyenv.
If your system has not the OpenSSL lib, you should like to OpenSSL lib under your home dir and set CFLAGS and LDFLAGS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants