huima58 / chartAnalyst

A deep learning research platform that recognizes stock charts through Convolutional Neural Network (CNN).
Apache License 2.0
18 stars 3 forks source link

i can not run the code #1

Open fjfzzl opened 8 years ago

fjfzzl commented 8 years ago

hi, thank u for the code. when i run chart_analyst.py, the system prompts the error below:

C:\Users\Administrator\Anaconda2\python.exe D:/zl/python/chartAnalyst-master-stock-cnn/chartAnalyst-master/chart_analyst.py Using Theano backend. train on 1994-02-25 0:0.328125 1:0.234375 2:0.4375 Traceback (most recent call last): File "D:/zl/python/chartAnalyst-master-stock-cnn/chartAnalyst-master/chart_analyst.py", line 157, in predict_rst = predict(train_imgs, train_labels, test_imgs, test_labels, weights_filename='./weights'+str(csv_data['Date'][i])+'.txt') File "D:/zl/python/chartAnalyst-master-stock-cnn/chartAnalyst-master/chart_analyst.py", line 105, in predict callbacks=[checkpointer, earlyStopping]) File "C:\Users\Administrator\Anaconda2\lib\site-packages\keras\models.py", line 408, in fit sample_weight=sample_weight) File "C:\Users\Administrator\Anaconda2\lib\site-packages\keras\engine\training.py", line 994, in fit batch_size=batch_size) File "C:\Users\Administrator\Anaconda2\lib\site-packages\keras\engine\training.py", line 925, in _standardize_user_data exception_prefix='model target') File "C:\Users\Administrator\Anaconda2\lib\site-packages\keras\engine\training.py", line 104, in standardize_input_data str(array.shape)) Exception: Error when checking model target: expected dense_3 to have shape (None, 3) but got array with shape (128L, 1L)

Process finished with exit code 1

is the code wrong? or missing something?

can you help me?

thanks for lot.

huima58 commented 8 years ago

Hi,

I tested the code OK in Mac and Linux (Ubuntu). Did not try it in Windows Anaconda yet. Could you try it in different systems? I may not have time recently to test it in Windows.

Thanks, Hui

On Mon, Jul 18, 2016 at 1:43 AM, fjfzzl notifications@github.com wrote:

hi, thank u for the code. when i run chart_analyst.py, the system prompts the error below:

C:\Users\Administrator\Anaconda2\python.exe D:/zl/python/chartAnalyst-master-stock-cnn/chartAnalyst-master/chart_analyst.py Using Theano backend. train on 1994-02-25 0:0.328125 1:0.234375 2:0.4375 Traceback (most recent call last): File "D:/zl/python/chartAnalyst-master-stock-cnn/chartAnalyst-master/chart_analyst.py", line 157, in predict_rst = predict(train_imgs, train_labels, test_imgs, test_labels, weights_filename='./weights'+str(csv_data['Date'][i])+'.txt') File "D:/zl/python/chartAnalyst-master-stock-cnn/chartAnalyst-master/chart_analyst.py", line 105, in predict callbacks=[checkpointer, earlyStopping]) File "C:\Users\Administrator\Anaconda2\lib\site-packages\keras\models.py", line 408, in fit sample_weight=sample_weight) File "C:\Users\Administrator\Anaconda2\lib\site-packages\keras\engine\training.py", line 994, in fit batch_size=batch_size) File "C:\Users\Administrator\Anaconda2\lib\site-packages\keras\engine\training.py", line 925, in _standardize_user_data exception_prefix='model target') File "C:\Users\Administrator\Anaconda2\lib\site-packages\keras\engine\training.py", line 104, in standardize_input_data str(array.shape)) Exception: Error when checking model target: expected dense_3 to have shape (None, 3) but got array with shape (128L, 1L)

Process finished with exit code 1

is the code wrong? or missing something?

can you help me?

thanks for lot.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/huima58/chartAnalyst/issues/1, or mute the thread https://github.com/notifications/unsubscribe-auth/AP_DW1vzXxKguIjI7ewV5KS5m9YvTqLQks5qWyB8gaJpZM4JOcm- .

fjfzzl commented 8 years ago

i am just run it in windows Anaconda. sorry, i can not run it in other systems now.

does anyother people have the same problem with me?

huima58 commented 8 years ago

It is a new project. No one tried Windows platform yet. Best, Hui

On Mon, Jul 18, 2016 at 10:01 PM, fjfzzl notifications@github.com wrote:

i am just run it in windows Anaconda. sorry, i can not run it in other systems now.

does anyother people have the same problem with me?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/huima58/chartAnalyst/issues/1#issuecomment-233517772, or mute the thread https://github.com/notifications/unsubscribe-auth/AP_DW_Unw-TPXrNrSo5-CAUzMVkX4CHCks5qXD4KgaJpZM4JOcm- .

huima58 commented 8 years ago

I think it is because of the old version keras. Which version are you using now? Can you try to install latest version keras. Mine is 1.0.4.

fjfzzl commented 8 years ago

My keras's version is 1.0.5. And i can run the sample code like cifar10_cnn.py etc. when i run your code in another PC which installed GPU. it raised another error below:

C:\Anaconda2\python.exe D:/快盘/量化投资/深度神经网络/chartAnalyst-master-stock-cnn/chartAnalyst-master/chart_analyst.py Using Theano backend. Using gpu device 0: GeForce GT 740 (CNMeM is enabled with initial size: 80.0% of memory, cuDNN not available) train on 1994-02-25 0:0.328125 1:0.234375 2:0.4375 Train on 115 samples, validate on 13 samples Epoch 1/30 Traceback (most recent call last): File "D:/����/����Ͷ��/���������/chartAnalyst-master-stock-cnn/chartAnalyst-master/chart_analyst.py", line 160, in predict_rst = predict(train_imgs, train_labels, test_imgs, test_labels, weights_filename='./weights'+str(csv_data['Date'][i])+'.txt') File "D:/����/����Ͷ��/���������/chartAnalyst-master-stock-cnn/chartAnalyst-master/chart_analyst.py", line 108, in predict callbacks=[checkpointer, earlyStopping]) File "C:\Anaconda2\lib\site-packages\keras\models.py", line 413, in fit sample_weight=sample_weight) File "C:\Anaconda2\lib\site-packages\keras\engine\training.py", line 1082, in fit callback_metrics=callback_metrics) File "C:\Anaconda2\lib\site-packages\keras\engine\training.py", line 801, in _fit_loop outs = f(ins_batch) File "C:\Anaconda2\lib\site-packages\keras\backend\theano_backend.py", line 531, in call return self.function(inputs) File "C:\Anaconda2\lib\site-packages\theano\compile\function_module.py", line 871, in call storage_map=getattr(self.fn, 'storage_map', None)) File "C:\Anaconda2\lib\site-packages\theano\gof\link.py", line 314, in raise_with_op reraise(exc_type, exc_value, exc_trace) File "C:\Anaconda2\lib\site-packages\theano\compile\function_module.py", line 859, in call outputs = self.fn() MemoryError: Error allocating 1174405120 bytes of device memory (CNMEM_STATUS_OUT_OF_MEMORY). Apply node that caused the error: GpuElemwise{Composite{(i0 * (i1 + Abs(i1)))},no_inplace}(CudaNdarrayConstant{[[[[ 0.5]]]]}, GpuElemwise{Add}[(0, 0)].0) Toposort index: 111 Inputs types: [CudaNdarrayType(float32, (True, True, True, True)), CudaNdarrayType(float32, 4D)] Inputs shapes: [(1, 1, 1, 1), (70, 64, 256, 256)] Inputs strides: [(0, 0, 0, 0), (4194304, 65536, 256, 1)] Inputs values: [CudaNdarray([[[[ 0.5]]]]), 'not shown'] Outputs clients: [[GpuDownsampleFactorMax{(2, 2),True}(GpuElemwise{Composite{(i0 * (i1 + Abs(i1)))},no_inplace}.0), GpuDownsampleFactorMaxGrad{(2, 2),True}(GpuElemwise{Composite{(i0 \ (i1 + Abs(i1)))},no_inplace}.0, GpuDownsampleFactorMax{(2, 2),True}.0, GpuSubtensor{::, ::, int64:int64:, int64:int64:}.0)]]

HINT: Re-running with most Theano optimization disabled could give you a back-trace of when this node was created. This can be done with by setting the Theano flag 'optimizer=fast_compile'. If that does not work, Theano optimizations can be disabled with 'optimizer=None'. HINT: Use the Theano flag 'exception_verbosity=high' for a debugprint and storage map footprint of this apply node.

Process finished with exit code 1

my PC is CPU intel core i5, 16G memory, GeForce GT 740 (2G memory). is my GPU memory too small ?

can you help me?

fjfzzl commented 8 years ago

dear sir.

i run your code in the ubuntu+anaconda+cuda, and still have the error like below.

2016-08-24 14-35-27

what wrong whit me?

cloudfengchao commented 7 years ago

@fjfzzl the screenshot says it is a memory error. Try setting CNMEM option in .theanorc to a smaller number.