facebookresearch / PoincareMaps

The need to understand cell developmental processes has spawned a plethora of computational methods for discovering hierarchies from scRNAseq data. However, existing techniques are based on Euclidean geometry which is not an optimal choice for modeling complex cell trajectories with multiple branches. To overcome this fundamental representation issue we propose Poincaré maps, a method harnessing the power of hyperbolic geometry into the realm of single-cell data analysis.
Other
148 stars 31 forks source link

Runtime error with autograd function / module requirements issue? #2

Closed jpcartailler closed 3 years ago

jpcartailler commented 4 years ago

Greetings and thank you for your work on this novel approach! We are pretty excited to try it out on our own data, and are currently trying to reproduce your results first to make sure we understand how to use the approach.

Upon trying to run one of the embeddings, we run into a problem. Note that the following is from a local install within a Win10/Conda environment. I've provided a package list below as well.

Since the error is RuntimeError: Legacy autograd function with non-static forward method is deprecated. Please use new-style autograd function with static forward method, I'll venture to say that I'm probably not using the precise version of PyTorch that PoincareMaps is expecting?

Thank you for advice/guidance.

(poincare) C:\data\PoincareMaps>python main.py --dset MyeloidProgenitors --batchsize -1 --cuda 1 --knn 30 --gamma 2.0 --sigma 2.0 --pca 0  --root root
Computing laplacian...
Laplacian computed in 0.03 sec
Computing RFA...
RFA computed in 0.02 sec
batchsize =  64
Starting training...
  0%|                                                  | 0/5000 [00:00<?, ?it/s]
Traceback (most recent call last):
  File "main.py", line 179, in <module>
    color_dict=color_dict)
  File "C:\data\PoincareMaps\train.py", line 41, in train
    loss = model.lossfn(model(inputs), targets)
  File "C:\Users\cartaij\AppData\Local\Continuum\miniconda3\envs\poincare\lib\site-packages\torch\nn\modules\module.py", line 550, in __call__
    result = self.forward(*input, **kwargs)
  File "C:\data\PoincareMaps\model.py", line 131, in forward
    dists = self.dist()(embs_inputs, embs_all).squeeze(-1)
  File "C:\Users\cartaij\AppData\Local\Continuum\miniconda3\envs\poincare\lib\site-packages\torch\autograd\function.py", line 145, in __call__
    "Legacy autograd function with non-static forward method is deprecated. "
RuntimeError: Legacy autograd function with non-static forward method is deprecated. Please use new-style autograd function with static forward method. (Example: https://pytorch.org/docs/stable/autograd.html#torch.autograd.Function)
# Name                    Version                   Build  Channel
blas                      1.0                         mkl
ca-certificates           2020.1.1                      0
certifi                   2020.4.5.1               py37_0
cudatoolkit               10.2.89              h74a9793_1
cycler                    0.10.0                   py37_0
freetype                  2.9.1                ha9979f8_1
icc_rt                    2019.0.0             h0cc432a_1
icu                       58.2                 ha925a31_3
intel-openmp              2020.1                      216
joblib                    0.15.1                     py_0
jpeg                      9b                   hb83a4c4_2
kiwisolver                1.2.0            py37h74a9793_0
libpng                    1.6.37               h2a8f88b_0
libtiff                   4.1.0                h56a325e_1
lz4-c                     1.9.2                h62dcd97_0
matplotlib                3.1.3                    py37_0
matplotlib-base           3.1.3            py37h64f37c6_0
mkl                       2020.1                      216
mkl-service               2.3.0            py37hb782905_0
mkl_fft                   1.0.15           py37h14836fe_0
mkl_random                1.1.1            py37h47e9c7a_0
ninja                     1.9.0            py37h74a9793_0
numpy                     1.18.1           py37h93ca92e_0
numpy-base                1.18.1           py37hc3f5095_1
olefile                   0.46                     py37_0
openssl                   1.1.1g               he774522_0
pandas                    1.0.3            py37h47e9c7a_0
pillow                    7.1.2            py37hcc1f983_0
pip                       20.0.2                   py37_3
pyparsing                 2.4.7                      py_0
pyqt                      5.9.2            py37h6538335_2
python                    3.7.7                h81c818b_4
python-dateutil           2.8.1                      py_0
pytorch                   1.5.0           py3.7_cuda102_cudnn7_0    pytorch
pytz                      2020.1                     py_0
qt                        5.9.7            vc14h73c81de_0
scikit-learn              0.22.1           py37h6288b17_0
scipy                     1.4.1            py37h9439919_0
seaborn                   0.10.1                     py_0
setuptools                47.1.1                   py37_0
sip                       4.19.8           py37h6538335_0
six                       1.15.0                     py_0
sqlite                    3.31.1               h2a8f88b_1
tk                        8.6.8                hfa6e2cd_0
torchvision               0.6.0                py37_cu102    pytorch
tornado                   6.0.4            py37he774522_1
tqdm                      4.46.0                     py_0
vc                        14.1                 h0510ff6_4
vs2015_runtime            14.16.27012          hf0eaf9b_2
wheel                     0.34.2                   py37_0
wincertstore              0.2                      py37_0
xz                        5.2.5                h62dcd97_0
zlib                      1.2.11               h62dcd97_4
zstd                      1.4.4                ha9fde0e_3
klanita commented 4 years ago

Hi! I was using pytorch 1.3.1 for this code. I will try to roll out a new version compatible with the latest pytorch in approximately 1-2 week. Thank you for your comment!