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

issue between matlab and python #1

Open
pplenck opened this issue Sep 19, 2023 · 1 comment
Open

issue between matlab and python #1

pplenck opened this issue Sep 19, 2023 · 1 comment

Comments

@pplenck
Copy link

pplenck commented Sep 19, 2023

Hello
I am super excited to test your cnn!

I created my environment as you proposed and got no issue, keras and tensorflow installed using the required versions.
( - h5py=2.10
- keras=2.4
- numpy=1.18
- python=3.8
- tensorflow=2.3)
)

Echoing the exec_path did not work
echo %CONDA_PREFIX%

gives %CONDA_PREFIX%
so I used conda env list to see where my cnn-env was:
exec_env='C:\ProgramData\Anaconda3\envs\cnn-env';

I got the data and samplingfreq prepared,
however when I ran in matlab (launched from conda):

Ripl_Proba=detect_ripples_cnn(data, fs, 'exec_env',exec_env );

I got the following isue on matlab :
any idea of what I missed?
thanks!

Error using h5>init h5py.h5 (line 41)
Python Error: AttributeError: type object 'h5py.h5.H5PYConfig' has no attribute 'reduce_cython'

Error in version> (line 17)
from . import h5 as _h5

Error in init> (line 34)
from . import version

Error in hdf5_format> (line 41)
import h5py

Error in training> (line 53)
from tensorflow.python.keras.saving import hdf5_format

Error in functional> (line 38)
from tensorflow.python.keras.engine import training as training_lib

Error in models> (line 26)
from tensorflow.python.keras.engine import functional

Error in init> (line 27)
from tensorflow.python.keras import models

Error in init> (line 47)
from tensorflow.python import keras

Error in init> (line 41)
from tensorflow.python.tools import module_util as _module_util

Error in model_class> (line 1)
import tensorflow.keras.backend as K

Error in cnn> (line 7)
import model_class

Error in _call_with_frames_removed (line 219)

Error in exec_module (line 843)

Error in _load_unlocked (line 671)

Error in _find_and_load_unlocked (line 975)

Error in _find_and_load (line 991)

Error in _gcd_import (line 1014)

Error in init>import_module (line 127)
return _bootstrap._gcd_import(name[level:], package, level)

@pplenck
Copy link
Author

pplenck commented Sep 19, 2023

'fixed it' by pip uninstalling h5py but had lots of incopatibilities reported:

Installing collected packages: h5py
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
tensorflow 2.3.0 requires gast==0.3.3, but you have gast 0.4.0 which is incompatible.
tensorflow 2.3.0 requires h5py<2.11.0,>=2.10.0, but you have h5py 3.9.0 which is incompatible.
tensorflow 2.3.0 requires scipy==1.4.1, but you have scipy 1.6.2 which is incompatible.
tensorflow 2.3.0 requires tensorflow-estimator<2.4.0,>=2.3.0, but you have tensorflow-estimator 2.6.0 which is incompatible.

but now it runs. however, In matlab I now get
Error using py.cnn.predict
Conversion of MATLAB 'double' to Python is only supported for 1-N vectors.

btw on what verision of Matlab do you run this?

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

1 participant