Skip to content

[Bug] Error of the function "compute_and_plot_total_velocity" #23

Description

@hywang01

Description

When plotting the stream plot using "compute_and_plot_total_velocity", an error occurs:

ValueError: Layer 'Velocity' needs to be of one of np.ndarray, numpy.ma.core.MaskedArray, scipy.sparse.spmatrix, awkward.Array, h5py.Dataset, zarr.Array, zappy.base.ZappyArray, anndata.experimental.[CSC,CSR]Dataset, dask.array.Array, cupy.ndarray, or cupyx.scipy.sparse.spmatrix, not <class 'torch.Tensor'>.

Note that I used GPU to compute the results of cell2fate.

Reproducing the issue

The cell [15] in the mouse pancreas tutorial:

mod.compute_and_plot_total_velocity(adata, save = results_path + data_name + 'total_velocity_plots.png', delete = False)

Expected behavior

I guess that the error was caused by data type conversion between torch and numpy.
The "torch.from_numpy" should be added to the line 616 of the file "_cell2fate_DynamicalModel.py".

System

  • OS: [Ubuntu 18.04]
  • Python version [3.9]
Dependencies versions
cell2fate==0.1a0

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions