jingshuw / SAVERX

R package for transfer learning of single-cell RNA-seq denoising
29 stars 9 forks source link

Problem running SAVERX:: Module not found #23

Closed GuiSeSanz closed 2 years ago

GuiSeSanz commented 2 years ago

Hi everyone!

I'm trying to run SAVERX, on a docker. I've installed all the necessary libraries as far as I know, but I still hitting this wall:

filepretrained <- saverx( "./hemato_data_raw.txt", data.species = "Human", 
 is.large.data = T, use.pretrain = T, pretrained.weights.file = "SAVERX_pretrained_weights/human_Immune.hdf5",  
model.species = "Human")

[1] "Input file is: ./hemato_data_raw.txt"
[1] "Use a pretrained model: Yes"
[1] "Data species is: Human"
[1] "Pretrained weights file is: SAVERX_pretrained_weights/human_Immune.hdf5"
[1] "Model species is: Human"
[1] "15548 genes mapped out of 15766"
[1] "Gene names mapped, resulting file saved as: 1635183112.38965/tmpdata.rds"
[1] "Reshaped file saved as: 1635183112.38965/tmpdata.mtx"
[1] "Nonmissing indicator saved as: 1635183112.38965/tmpdata_nonmissing.txt"
[1] "Data preprocessed ..."
Error in py_module_import(module, convert = convert) : 
  ModuleNotFoundError: No module named 'keras.objectives'

Detailed traceback:
  File "/usr/local/lib/R/site-library/reticulate/python/rpytools/loader.py", line 39, in _import_hook
    module = _import(
  File "/usr/local/lib/python3.8/dist-packages/sctransfer/__init__.py", line 5, in <module>
    from . import api, api_pretrain
  File "/usr/local/lib/R/site-library/reticulate/python/rpytools/loader.py", line 39, in _import_hook
    module = _import(
  File "/usr/local/lib/python3.8/dist-packages/sctransfer/api.py", line 16, in <module>
    from .network import NBConstantDispAutoencoder
  File "/usr/local/lib/R/site-library/reticulate/python/rpytools/loader.py", line 39, in _import_hook
    module = _import(
  File "/usr/local/lib/python3.8/dist-packages/sctransfer/network.py", line 10, in <module>
    from keras.objectives import mean_squared_error
  File "/usr/local/lib/R/site-library/reticulate/python/rpytools/loader.py", line 39, in _import_hook
    module = _import(

The problem seem to at the moment of passing the 'keras.objectives' from python to R... But I cannot find this keras.objectives on the keras documentation, so I do not know if it's a deprecated function or anything...

tf.version == '2.6.0'

What should I do?

Thanks!

jingshuw commented 2 years ago

I have updated the version requirement so that SAVERX only works with tensorflow <=2.2.0 and Keras<=2.3.0