sdtm_mapper
sdtm_mapper copied to clipboard
Compatibility issue
Hi, I was trying to use the package but ran into the following error. It may be version issue around Keras and Tensorflow. I tried importing packages differently but did not solve the problem. Any insight would be appreciated.
Thanks, Xiaolong
ImportError Traceback (most recent call last)
~/anaconda3/lib/python3.8/site-packages/sdtm_mapper/SDTMModels.py in
ImportError: cannot import name 'to_categorical' from 'keras.utils' (/home/xluo/anaconda3/lib/python3.8/site-packages/keras/utils/init.py)
Hi, I had the same issue.
If you try from tensorflow.python.keras.utils.np_utils import to_categorical rather than keras.utils, it may not occur any error.
However, I encountered the import error in the 20th line, and haven't found any solution yet.
I guess it's also a kind of Tensorflow version problem.
Additionally, for 20th line, How about using keras.engine.base_layer? I don't know actual meanings of all tf codes, so I just looked whether the code has a Layer class or method, and I found that the keras.engine.base_layer has the Layer class.