aertslab / scenicplus

SCENIC+ is a python package to build gene regulatory networks (GRNs) using combined or separate single-cell gene expression (scRNA-seq) and single-cell chromatin accessibility (scATAC-seq) data.
Other
178 stars 28 forks source link

Ray error when running pycistarget #136

Open sarah-chapin opened 1 year ago

sarah-chapin commented 1 year ago

Hello,

I am trying to run pycistarget using the following code:

if not ray.is_initialized():
    ray.init(local_mode=True, num_cpus = 8, ignore_reinit_error=True)                                                           
    ray.remote(max_retries=0)
    run_pycistarget(
            region_sets = region_sets,
            species = 'homo_sapiens',
            save_path = 'motifs',
            ctx_db_path = rankings_db,
            dem_db_path = scores_db,
            path_to_motif_annotations = motif_annotation,
            run_without_promoters = True,
            n_cpu = 8,
            annotation_version = 'v10nr_clust')

I am receiving the following error with Ray:

2023-04-02 13:10:52,559 ERROR services.py:1169 -- Failed to start the dashboard , return code -11
2023-04-02 13:10:52,559 ERROR services.py:1194 -- Error should be written to 'dashboard.log' or 'dashboard.err'. We are printing the last 20 lines for you. See 'https://docs.ray.io/en/master/ray-observability/ray-logging.html#logging-directory-structure' to find where the log file is.
2023-04-02 13:10:52,559 ERROR services.py:1238 -- 
The last 20 lines of /tmp/5728721.1.comp.q/ray/session_2023-04-02_13-10-50_245958_430038/logs/dashboard.log (it contains the error message from the dashboard): 
2023-04-02 13:10:52,132 INFO head.py:239 -- Starting dashboard metrics server on port 44227

2023-04-02 13:10:52,964 INFO worker.py:1553 -- Started a local Ray instance.
Traceback (most recent call last):
  File "raise RuntimeError(
RuntimeError: Maybe you called ray.init twice by accident? This error can be suppressed by passing in 'ignore_reinit_error=True' or by calling 'ray.shutdown()' prior to 'ray.init()'.

Do you have any suggestions about how to resolve this error?

pajucon commented 1 year ago

ray.init() is called inside run_pycistarget(). Try omitting your ray code before run_pycistarget().

In some cases, you might need to call ray.shutdown() prior to running these parallelized methods if the method encountered an error before ray.shutdown() is called.

sarah-chapin commented 1 year ago

I removed the ray code before run_pycistarget(). I am now receiving the following error, regardless of whether or not I call ray.shutdown() prior to run_pycistarget():

2023-04-27 15:02:54,072 ERROR services.py:1169 -- Failed to start the dashboard , return code -11
2023-04-27 15:02:54,072 ERROR services.py:1194 -- Error should be written to 'dashboard.log' or 'dashboard.err'. We are printing the last 20 lines for you. See 'https://docs.r
ay.io/en/master/ray-observability/ray-logging.html#logging-directory-structure' to find where the log file is.
2023-04-27 15:02:54,072 ERROR services.py:1238 -- 
The last 20 lines of /tmp/5807804.1.comp.q/ray/session_2023-04-27_15-02-50_588745_4015583/logs/dashboard.log (it contains the error message from the dashboard): 
2023-04-27 15:02:53,590 INFO head.py:239 -- Starting dashboard metrics server on port 44227

2023-04-27 15:02:54,911 INFO worker.py:1553 -- Started a local Ray instance.
[2023-04-27 15:02:55,581 E 4015583 4015583] core_worker.cc:191: Failed to register worker 01000000ffffffffffffffffffffffffffffffffffffffffffffffff to Raylet. IOError: [RayletClient] Unable to register worker with raylet. No such file or directory
SeppeDeWinter commented 1 year ago

Hi @sarah-chapin

I'm not sure what is going wrong ...

Did you happen to be running ray at the same time in two notebooks? See: https://github.com/ray-project/ray/issues/21479

Best,

Seppe