There might be an error with the latest keras (3.05) library. I'm getting an error that I'm not getting on a system with older tensorflow and keras libraries. Here is the output:
2024-03-12 21:45:39.279064: I external/local_tsl/tsl/cuda/cudart_stub.cc:32] Could not find cuda drivers on your machine, GPU will not be used.
2024-03-12 21:45:39.281672: I external/local_tsl/tsl/cuda/cudart_stub.cc:32] Could not find cuda drivers on your machine, GPU will not be used.
2024-03-12 21:45:39.313266: I tensorflow/core/platform/cpu_feature_guard.cc:210] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2024-03-12 21:45:39.908591: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
Traceback (most recent call last):
File "/bio/bin/python-env/bin/deepsig", line 8, in <module>
sys.exit(main())
^^^^^^
File "/bio/bin/python-env/lib/python3.11/site-packages/deepsig/deepsig.py", line 59, in main
Y, Ytm, Ync, cls, Ytm_norm, Ync_norm = detectsp(X, ns.organism)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/bio/bin/python-env/lib/python3.11/site-packages/deepsig/helpers.py", line 63, in detectsp
dnn = model_from_json(json.load(open("%s.arch.json" % modpfx)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/bio/bin/python-env/lib/python3.11/site-packages/keras/src/models/model.py", line 550, in model_from_json
return serialization_lib.deserialize_keras_object(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/bio/bin/python-env/lib/python3.11/site-packages/keras/src/saving/serialization_lib.py", line 687, in deserialize_keras_object
cls = _retrieve_class_or_fn(
^^^^^^^^^^^^^^^^^^^^^^
File "/bio/bin/python-env/lib/python3.11/site-packages/keras/src/saving/serialization_lib.py", line 805, in _retrieve_class_or_fn
[Tue, 12 Mar 2024 21:45:40] Reading input data
[Tue, 12 Mar 2024 21:45:41] Read 4164 protein sequences
[Tue, 12 Mar 2024 21:45:41] Detecting signal peptides
[Tue, 12 Mar 2024 21:45:41] Errors occured during execution
[Tue, 12 Mar 2024 21:45:41] Leaving outdir unchanged
raise TypeError(
TypeError: Could not locate class 'Model'. Make sure custom classes are decorated with `@keras.saving.register_keras_serializable()`. Full object config: {'class_name': 'Model', 'keras_version': '2.0.0', 'config': {'layers': [{'class_name': 'InputLayer', 'config': {'dtype': 'float32', 'batch_input_shape': [None, 96, 20], 'name': 'input_1', 'sparse': False}, 'inbound_nodes': [], 'name': 'input_1'}, {'class_name': 'Conv1D', 'config': {'kernel_constraint': None, 'kernel_initializer': {'class_name': 'VarianceScaling', 'config': {'distribution': 'uniform', 'scale': 1.0, 'seed': None, 'mode': 'fan_avg'}}, 'name': 'conv1d_1', 'bias_regularizer': None, 'bias_constraint': None, 'activation': 'relu', 'trainable': True, 'padding': 'same', 'strides': [1], 'dilation_rate': [1], 'kernel_regularizer': None, 'filters': 32, 'bias_initializer': {'class_name': 'VarianceScaling', 'config': {'distribution': 'uniform', 'scale': 1.0, 'seed': None, 'mode': 'fan_avg'}}, 'use_bias': True, 'activity_regularizer': None, 'kernel_size': [19]}, 'inbound_nodes': [[['input_1', 0, 0, {}]]], 'name': 'conv1d_1'}, {'class_name': 'AveragePooling1D', 'config': {'padding': 'valid', 'strides': [2], 'trainable': True, 'name': 'average_pooling1d_1', 'pool_size': [2]}, 'inbound_nodes': [[['conv1d_1', 0, 0, {}]]], 'name': 'average_pooling1d_1'}, {'class_name': 'Conv1D', 'config': {'kernel_constraint': None, 'kernel_initializer': {'class_name': 'VarianceScaling', 'config': {'distribution': 'uniform', 'scale': 1.0, 'seed': None, 'mode': 'fan_avg'}}, 'name': 'conv1d_2', 'bias_regularizer': None, 'bias_constraint': None, 'activation': 'relu', 'trainable': True, 'padding': 'same', 'strides': [1], 'dilation_rate': [1], 'kernel_regularizer': None, 'filters': 64, 'bias_initializer': {'class_name': 'VarianceScaling', 'config': {'distribution': 'uniform', 'scale': 1.0, 'seed': None, 'mode': 'fan_avg'}}, 'use_bias': True, 'activity_regularizer': None, 'kernel_size': [19]}, 'inbound_nodes': [[['average_pooling1d_1', 0, 0, {}]]], 'name': 'conv1d_2'}, {'class_name': 'AveragePooling1D', 'config': {'padding': 'valid', 'strides': [2], 'trainable': True, 'name': 'average_pooling1d_2', 'pool_size': [2]}, 'inbound_nodes': [[['conv1d_2', 0, 0, {}]]], 'name': 'average_pooling1d_2'}, {'class_name': 'Conv1D', 'config': {'kernel_constraint': None, 'kernel_initializer': {'class_name': 'VarianceScaling', 'config': {'distribution': 'uniform', 'scale': 1.0, 'seed': None, 'mode': 'fan_avg'}}, 'name': 'conv1d_3', 'bias_regularizer': None, 'bias_constraint': None, 'activation': 'relu', 'trainable': True, 'padding': 'same', 'strides': [1], 'dilation_rate': [1], 'kernel_regularizer': None, 'filters': 128, 'bias_initializer': {'class_name': 'VarianceScaling', 'config': {'distribution': 'uniform', 'scale': 1.0, 'seed': None, 'mode': 'fan_avg'}}, 'use_bias': True, 'activity_regularizer': None, 'kernel_size': [19]}, 'inbound_nodes': [[['average_pooling1d_2', 0, 0, {}]]], 'name': 'conv1d_3'}, {'class_name': 'AveragePooling1D', 'config': {'padding': 'valid', 'strides': [2], 'trainable': True, 'name': 'average_pooling1d_3', 'pool_size': [2]}, 'inbound_nodes': [[['conv1d_3', 0, 0, {}]]], 'name': 'average_pooling1d_3'}, {'class_name': 'Flatten', 'config': {'trainable': True, 'name': 'flatten_1'}, 'inbound_nodes': [[['average_pooling1d_3', 0, 0, {}]]], 'name': 'flatten_1'}, {'class_name': 'Dense', 'config': {'kernel_initializer': {'class_name': 'VarianceScaling', 'config': {'distribution': 'uniform', 'scale': 1.0, 'seed': None, 'mode': 'fan_avg'}}, 'name': 'dense_1', 'kernel_constraint': None, 'bias_regularizer': None, 'bias_constraint': None, 'activation': 'relu', 'trainable': True, 'kernel_regularizer': None, 'bias_initializer': {'class_name': 'VarianceScaling', 'config': {'distribution': 'uniform', 'scale': 1.0, 'seed': None, 'mode': 'fan_avg'}}, 'units': 16, 'use_bias': True, 'activity_regularizer': None}, 'inbound_nodes': [[['flatten_1', 0, 0, {}]]], 'name': 'dense_1'}, {'class_name': 'Dropout', 'config': {'rate': 0.25, 'trainable': True, 'name': 'dropout_1'}, 'inbound_nodes': [[['dense_1', 0, 0, {}]]], 'name': 'dropout_1'}, {'class_name': 'Dense', 'config': {'kernel_initializer': {'class_name': 'VarianceScaling', 'config': {'distribution': 'uniform', 'scale': 1.0, 'seed': None, 'mode': 'fan_avg'}}, 'name': 'dense_2', 'kernel_constraint': None, 'bias_regularizer': None, 'bias_constraint': None, 'activation': 'softmax', 'trainable': True, 'kernel_regularizer': None, 'bias_initializer': {'class_name': 'VarianceScaling', 'config': {'distribution': 'uniform', 'scale': 1.0, 'seed': None, 'mode': 'fan_avg'}}, 'units': 3, 'use_bias': True, 'activity_regularizer': None}, 'inbound_nodes': [[['dropout_1', 0, 0, {}]]], 'name': 'dense_2'}], 'input_layers': [['input_1', 0, 0]], 'output_layers': [['dense_2', 0, 0]], 'name': 'model_1'}, 'backend': 'tensorflow'}
There might be an error with the latest keras (3.05) library. I'm getting an error that I'm not getting on a system with older tensorflow and keras libraries. Here is the output:
This is with keras-3.0.5 and tensorflow-2.16.