xypan1232 / IPMiner

Predicting ncRNA-protein interaction using high-level features based on deep learning
15 stars 8 forks source link

the function "multiple_layer_autoencoder" dose not work #4

Open xiaowenchenjax opened 6 years ago

xiaowenchenjax commented 6 years ago

Hi i run the following script using the dataset "RPI488" encoders1 = multiple_layer_autoencoder(train1, test1, activation = 'sigmoid', batch_size = 100, nb_epoch = 100, last_dim = 64) when it trained the second layer, error happened: Training the layer 1: Input 343 -> Output 256 388/388 [==============================] - 0s (388, 343) Training the layer 2: Input 256 -> Output 128 Traceback (most recent call last): File "", line 1, in File "", line 17, in multiple_layer_autoencoder File "/home/chenx/anaconda2/envs/myenv/lib/python2.7/site-packages/Keras-0.1.1-py2.7.egg/keras/models.py", line 187, in fit File "/home/chenx/anaconda2/envs/myenv/lib/python2.7/site-packages/theano/compile/function_module.py", line 917, in call storage_map=getattr(self.fn, 'storage_map', None)) File "/home/chenx/anaconda2/envs/myenv/lib/python2.7/site-packages/theano/gof/link.py", line 325, in raise_with_op reraise(exc_type, exc_value, exc_trace) File "/home/chenx/anaconda2/envs/myenv/lib/python2.7/site-packages/theano/compile/function_module.py", line 903, in call self.fn() if output_subset is None else\ ValueError: Shape mismatch: x has 343 cols (and 100 rows) but y has 256 rows (and 128 cols) Apply node that caused the error: Dot22(<TensorType(float64, matrix)>, <TensorType(float64, matrix)>) Toposort index: 4 Inputs types: [TensorType(float64, matrix), TensorType(float64, matrix)] Inputs shapes: [(100, 343), (256, 128)] Inputs strides: [(2744, 8), (1024, 8)] Inputs values: ['not shown', 'not shown'] Outputs clients: [[Elemwise{Composite{scalar_sigmoid((i0 + i1))}}[(0, 0)](Dot22.0, InplaceDimShuffle{x,0}.0)]]

Backtrace when the node is created(use Theano flag traceback.limit=N to make it longer): File "/home/chenx/anaconda2/envs/myenv/lib/python2.7/site-packages/Keras-0.1.1-py2.7.egg/keras/layers/core.py", line 150, in get_output X = self.get_input(train) File "/home/chenx/anaconda2/envs/myenv/lib/python2.7/site-packages/Keras-0.1.1-py2.7.egg/keras/layers/core.py", line 29, in get_input return self.previous.get_output(train=train) File "/home/chenx/anaconda2/envs/myenv/lib/python2.7/site-packages/Keras-0.1.1-py2.7.egg/keras/layers/core.py", line 382, in get_output decoded = self.decoder.get_output(train) File "/home/chenx/anaconda2/envs/myenv/lib/python2.7/site-packages/Keras-0.1.1-py2.7.egg/keras/layers/containers.py", line 40, in get_output return self.layers[-1].get_output(train) File "/home/chenx/anaconda2/envs/myenv/lib/python2.7/site-packages/Keras-0.1.1-py2.7.egg/keras/layers/core.py", line 268, in get_output X = self.get_input(train) File "/home/chenx/anaconda2/envs/myenv/lib/python2.7/site-packages/Keras-0.1.1-py2.7.egg/keras/layers/core.py", line 29, in get_input return self.previous.get_output(train=train) File "/home/chenx/anaconda2/envs/myenv/lib/python2.7/site-packages/Keras-0.1.1-py2.7.egg/keras/layers/containers.py", line 40, in get_output return self.layers[-1].get_output(train) File "/home/chenx/anaconda2/envs/myenv/lib/python2.7/site-packages/Keras-0.1.1-py2.7.egg/keras/layers/core.py", line 269, in get_output output = self.activation(T.dot(X, self.W) + self.b)

HINT: Use the Theano flag 'exception_verbosity=high' for a debugprint and storage map footprint of this apply node.

So could you help me? thanks a lot

xypan1232 commented 6 years ago

Hi,

Your keras version is v0.1.2 and the backend is theano?

xiaowenchenjax commented 6 years ago

Thank you for your reply, my backend is theano. but i could not install keras v0.1.2. firstly, i try the "conda install -c alejandrito keras ", but in linux and oxs system, after i installed it. the version of keras is v0.1.1. secondly, i tried "conda install -c alchayward keras", after i installed, the version of keras is v2.2.0. so i used kerasv0.1.1 to run your script.

Could you tell me how to install keras v0.1.2. i have no idea. thank you very much.

xypan1232 commented 6 years ago

install it from source code: https://github.com/keras-team/keras/releases/tag/0.1.2

xiaowenchenjax commented 6 years ago

Thank you very much. You save me!!

xiaowenchenjax commented 6 years ago

Sorry,could you tell me how to install keras from source code in anaconda? could i install it in linux and window system?

xypan1232 commented 6 years ago

I do not know how to install in anaconda. I ran these code on Linux.

xiaowenchenjax commented 6 years ago

i am using the command line "pip install git+git://github.com/keras-team/keras.git@0.1.2", but it still install keras 0.1.1.please see the detail in the following: $ pip install git+git://github.com/keras-team/keras.git@0.1.2 Collecting git+git://github.com/keras-team/keras.git@0.1.2 Cloning git://github.com/keras-team/keras.git (to revision 0.1.2) to /private/var/folders/bj/x8qy2wtj48bblxcqf24q6c640000gn/T/pip-req-build-yYsSCS Requirement already satisfied (use --upgrade to upgrade): Keras==0.1.1 from git+git://github.com/keras-team/keras.git@0.1.2 in ./anaconda2/lib/python2.7/site-packages Requirement already satisfied: theano in ./anaconda2/lib/python2.7/site-packages (from Keras==0.1.1) (1.0.2+2.gc449c8699) Requirement already satisfied: pyyaml in ./anaconda2/lib/python2.7/site-packages (from Keras==0.1.1) (3.12) Requirement already satisfied: numpy>=1.9.1 in ./anaconda2/lib/python2.7/site-packages (from theano->Keras==0.1.1) (1.14.3) Requirement already satisfied: scipy>=0.14 in ./anaconda2/lib/python2.7/site-packages (from theano->Keras==0.1.1) (1.1.0) Requirement already satisfied: six>=1.9.0 in ./anaconda2/lib/python2.7/site-packages (from theano->Keras==0.1.1) (1.11.0) Building wheels for collected packages: Keras Running setup.py bdist_wheel for Keras ... done Stored in directory: /private/var/folders/bj/x8qy2wtj48bblxcqf24q6c640000gn/T/pip-ephem-wheel-cache-t72zHl/wheels/fe/12/34/468706f52790c6a2d9915a10b20fa2f42201c71030fb329e2e Successfully built Keras distributed 1.21.8 requires msgpack, which is not installed. grin 1.2.1 requires argparse>=1.1, which is not installed. ### thanks

xypan1232 commented 6 years ago

why not use python setup.py install?

xiaowenchenjax commented 6 years ago

Thanks a lot. it works