LiLabAtVT / DeepTE

Neural network classification of TE
BSD 3-Clause "New" or "Revised" License
85 stars 7 forks source link

'str' object has no attribute 'decode' #10

Closed bsierieb1 closed 3 years ago

bsierieb1 commented 3 years ago

Hi,

I am trying to run DeepTE with sample input data: /Applications/DeepTE/DeepTE/DeepTE.py -d tmp -o out -i /Applications/DeepTE/DeepTE/example_data/input_test.fasta -sp M -m_dir Metazoans_model

I get the following error message:

Using TensorFlow backend.
start time is 1635866439.932572
Step1: transfer fasta data to CNN input data
Step2: classify TEs
Step2: 2) domain information is not exist
Traceback (most recent call last):
  File "/Applications/DeepTE/DeepTE/DeepTE.py", line 274, in <module>
    main()
  File "/Applications/DeepTE/DeepTE/DeepTE.py", line 249, in main
    pipeline_no_m.classify_pipeline(model_dir, input_CNN_data_file, temp_store_opt_dir, sp_type,te_fam,prop_thr)
  File "/Applications/DeepTE/DeepTE/scripts/DeepTE_pipeline_no_modification.py", line 339, in classify_pipeline
    predict_te(model_file_dic[model_name], model_name, x_all_test_list, y_all_test_nm_list,input_spe_type,y_all_test_nm_list,prop_thr)
  File "/Applications/DeepTE/DeepTE/scripts/DeepTE_pipeline_no_modification.py", line 210, in predict_te
    model = load_model(model)
  File "/opt/anaconda3/envs/deepte/lib/python3.6/site-packages/keras/engine/saving.py", line 419, in load_model
    model = _deserialize_model(f, custom_objects, compile)
  File "/opt/anaconda3/envs/deepte/lib/python3.6/site-packages/keras/engine/saving.py", line 224, in _deserialize_model
    model_config = json.loads(model_config.decode('utf-8'))
AttributeError: 'str' object has no attribute 'decode'

Any tips? I downloaded Metazoans_model from the cyverse link and unpacked the archive.

Thanks in advance!

bsierieb1 commented 3 years ago

Ok, I tried generating a domain file using DeepTE_domain.py, and I keep getting the same error:

Using TensorFlow backend.
start time is 1635868504.546261
Step1: transfer fasta data to CNN input data
Step2: classify TEs
Step2: 1) domain information is exist
Traceback (most recent call last):
  File "/Applications/DeepTE/DeepTE/DeepTE.py", line 274, in <module>
    main()
  File "/Applications/DeepTE/DeepTE/DeepTE.py", line 243, in main
    pipeline_yes_m.classify_pipeline(model_dir, input_CNN_data_file, temp_store_opt_dir, sp_type,te_domain_pattern_dic,te_fam,prop_thr)
  File "/Applications/DeepTE/DeepTE/scripts/DeepTE_pipeline_yes_modification.py", line 540, in classify_pipeline
    predict_te(model_file_dic[model_name], model_name, x_all_test_list, y_all_test_nm_list,input_spe_type,te_domain_pattern_dic,y_all_test_nm_list,prop_thr)
  File "/Applications/DeepTE/DeepTE/scripts/DeepTE_pipeline_yes_modification.py", line 218, in predict_te
    model = load_model(model)
  File "/opt/anaconda3/envs/deepte/lib/python3.6/site-packages/keras/engine/saving.py", line 419, in load_model
    model = _deserialize_model(f, custom_objects, compile)
  File "/opt/anaconda3/envs/deepte/lib/python3.6/site-packages/keras/engine/saving.py", line 224, in _deserialize_model
    model_config = json.loads(model_config.decode('utf-8'))
AttributeError: 'str' object has no attribute 'decode'
bsierieb1 commented 3 years ago

ok, downgrading h5py to 2.10.0 (pip install h5py==2.10.0) following advice here solved the issue!