jessieren / DeepVirFinder

Identifying viruses from metagenomic data by deep learning
Other
116 stars 32 forks source link

AttributeError: ('The following error happened while compiling the node', DotModulo(A, s, m, A2, s2, m2), '\n', "module 'numpy.core.multiarray' has no attribute '_get_ndarray_c_version'") #31

Open linda5mith opened 2 years ago

linda5mith commented 2 years ago

Just installed DeepVirFinder and configured my conda env, not sure what could be going wrong?

Full traceback:

python /home/linda/DeepVirFinder/dvf.py -i nonredundant_contigs.fasta -m /home/linda/DeepVirFinder/models -o ./deepvirfinder -l 1000 -c 5

Using Theano backend.
WARNING (theano.tensor.blas): Using NumPy C-API based implementation for BLAS functions.
1. Loading Models.
   model directory /home/linda/DeepVirFinder/models
Traceback (most recent call last):
  File "/home/linda/DeepVirFinder/dvf.py", line 131, in <module>
    modDict[contigLengthk] = load_model(os.path.join(modDir, modName))
  File "/home/linda/anaconda3/envs/deepvirfinder/lib/python3.6/site-packages/keras/engine/saving.py", line 419, in load_model
    model = _deserialize_model(f, custom_objects, compile)
  File "/home/linda/anaconda3/envs/deepvirfinder/lib/python3.6/site-packages/keras/engine/saving.py", line 225, in _deserialize_model
    model = model_from_config(model_config, custom_objects=custom_objects)
  File "/home/linda/anaconda3/envs/deepvirfinder/lib/python3.6/site-packages/keras/engine/saving.py", line 458, in model_from_config
    return deserialize(config, custom_objects=custom_objects)
  File "/home/linda/anaconda3/envs/deepvirfinder/lib/python3.6/site-packages/keras/layers/__init__.py", line 55, in deserialize
    printable_module_name='layer')
  File "/home/linda/anaconda3/envs/deepvirfinder/lib/python3.6/site-packages/keras/utils/generic_utils.py", line 145, in deserialize_keras_object
    list(custom_objects.items())))
  File "/home/linda/anaconda3/envs/deepvirfinder/lib/python3.6/site-packages/keras/engine/network.py", line 1032, in from_config
    process_node(layer, node_data)
  File "/home/linda/anaconda3/envs/deepvirfinder/lib/python3.6/site-packages/keras/engine/network.py", line 991, in process_node
    layer(unpack_singleton(input_tensors), **kwargs)
  File "/home/linda/anaconda3/envs/deepvirfinder/lib/python3.6/site-packages/keras/engine/base_layer.py", line 431, in __call__
    self.build(unpack_singleton(input_shapes))
  File "/home/linda/anaconda3/envs/deepvirfinder/lib/python3.6/site-packages/keras/layers/convolutional.py", line 141, in build
    constraint=self.kernel_constraint)
  File "/home/linda/anaconda3/envs/deepvirfinder/lib/python3.6/site-packages/keras/legacy/interfaces.py", line 91, in wrapper
    return func(*args, **kwargs)
  File "/home/linda/anaconda3/envs/deepvirfinder/lib/python3.6/site-packages/keras/engine/base_layer.py", line 249, in add_weight
    weight = K.variable(initializer(shape),
  File "/home/linda/anaconda3/envs/deepvirfinder/lib/python3.6/site-packages/keras/initializers.py", line 218, in __call__
    dtype=dtype, seed=self.seed)
  File "/home/linda/anaconda3/envs/deepvirfinder/lib/python3.6/site-packages/keras/backend/theano_backend.py", line 2600, in random_uniform
    return rng.uniform(shape, low=minval, high=maxval, dtype=dtype)
  File "/home/linda/anaconda3/envs/deepvirfinder/lib/python3.6/site-packages/theano/sandbox/rng_mrg.py", line 872, in uniform
    rstates = self.get_substream_rstates(nstreams, dtype)
  File "/home/linda/anaconda3/envs/deepvirfinder/lib/python3.6/site-packages/theano/configparser.py", line 117, in res
    return f(*args, **kwargs)
  File "/home/linda/anaconda3/envs/deepvirfinder/lib/python3.6/site-packages/theano/sandbox/rng_mrg.py", line 779, in get_substream_rstates
    multMatVect(rval[0], A1p72, M1, A2p72, M2)
  File "/home/linda/anaconda3/envs/deepvirfinder/lib/python3.6/site-packages/theano/sandbox/rng_mrg.py", line 62, in multMatVect
    [A_sym, s_sym, m_sym, A2_sym, s2_sym, m2_sym], o, profile=False)
  File "/home/linda/anaconda3/envs/deepvirfinder/lib/python3.6/site-packages/theano/compile/function.py", line 317, in function
    output_keys=output_keys)
  File "/home/linda/anaconda3/envs/deepvirfinder/lib/python3.6/site-packages/theano/compile/pfunc.py", line 486, in pfunc
    output_keys=output_keys)
  File "/home/linda/anaconda3/envs/deepvirfinder/lib/python3.6/site-packages/theano/compile/function_module.py", line 1841, in orig_function
    fn = m.create(defaults)
  File "/home/linda/anaconda3/envs/deepvirfinder/lib/python3.6/site-packages/theano/compile/function_module.py", line 1715, in create
    input_storage=input_storage_lists, storage_map=storage_map)
  File "/home/linda/anaconda3/envs/deepvirfinder/lib/python3.6/site-packages/theano/gof/link.py", line 699, in make_thunk
    storage_map=storage_map)[:3]
  File "/home/linda/anaconda3/envs/deepvirfinder/lib/python3.6/site-packages/theano/gof/vm.py", line 1091, in make_all
    impl=impl))
  File "/home/linda/anaconda3/envs/deepvirfinder/lib/python3.6/site-packages/theano/gof/op.py", line 955, in make_thunk
    no_recycling)
  File "/home/linda/anaconda3/envs/deepvirfinder/lib/python3.6/site-packages/theano/gof/op.py", line 858, in make_c_thunk
    output_storage=node_output_storage)
  File "/home/linda/anaconda3/envs/deepvirfinder/lib/python3.6/site-packages/theano/gof/cc.py", line 1217, in make_thunk
    keep_lock=keep_lock)
  File "/home/linda/anaconda3/envs/deepvirfinder/lib/python3.6/site-packages/theano/gof/cc.py", line 1157, in __compile__
    keep_lock=keep_lock)
  File "/home/linda/anaconda3/envs/deepvirfinder/lib/python3.6/site-packages/theano/gof/cc.py", line 1609, in cthunk_factory
    key = self.cmodule_key()
  File "/home/linda/anaconda3/envs/deepvirfinder/lib/python3.6/site-packages/theano/gof/cc.py", line 1300, in cmodule_key
    c_compiler=self.c_compiler(),
  File "/home/linda/anaconda3/envs/deepvirfinder/lib/python3.6/site-packages/theano/gof/cc.py", line 1379, in cmodule_key_
    np.core.multiarray._get_ndarray_c_version())
AttributeError: ('The following error happened while compiling the node', DotModulo(A, s, m, A2, s2, m2), '\n', "module 'numpy.core.multiarray' has no attribute '_get_ndarray_c_version'")
linda5mith commented 2 years ago

Solution was to conda install -c conda-forge theano=1.0.4

You should update your documentation to reflect this bug:

conda install python=3.6 numpy theano=1.0.4 keras=2.2.4 scikit-learn Biopython h5py

zhongshengbin269 commented 2 years ago

Hi there, May I ask you how to solve this problem? I have the same problem as you.

yugen-miyahara commented 2 years ago

Hi there, I am also getting this problem and tried updating to theano-1.0.4 like you did. But I am still getting the same error.