kausmees / GenoCAE

Convolutional autoencoder for genotype data
BSD 3-Clause "New" or "Revised" License
15 stars 10 forks source link

Suggest: shorter error message when --datadir is not found #9

Open richelbilderbeek opened 3 years ago

richelbilderbeek commented 3 years ago

Dear GCAE maintainer,

Here I try to convince you to give a shorter error message when --datadir is absent.

Thanks for the GCAE examples provided; these are very helpful!

When I run the example code of the first GCAE training example ...

python3 run_gcae.py train --datadir example_tiny/ --data HumanOrigins249_tiny --model_id M1  --epochs 20 --save_interval 2  --train_opts_id ex3  --data_opts_id b_0_4

I get a clear-but-long error message:

2021-06-28 13:48:01.293305: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'libcudart.so.10.1'; dlerror: libcudart.so.10.1: cannot open shared object file: No such file or directory
2021-06-28 13:48:01.293338: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
tensorflow version 2.3.3
Traceback (most recent call last):
  File "/home/richel/.local/share/gcaer/gcae_v1_0/run_gcae.py", line 396, in <module>
    with open("data_opts/" + data_opts_id+".json") as data_opts_def_file:
FileNotFoundError: [Errno 2] No such file or directory: 'data_opts/b_0_4.json'

The drawback is that this is too long of an error message for R to display (here I use the gcaer R package):

Screenshot from 2021-06-28 13-39-44

Also, one could argue that initializing Tensorflow and looking for CUDA should be done after checking if the CLI arguments are valid.

In that way, the error message would shorten to the lines below and I would be happy:

Traceback (most recent call last):
  File "/home/richel/.local/share/gcaer/gcae_v1_0/run_gcae.py", line 396, in <module>
    with open("data_opts/" + data_opts_id+".json") as data_opts_def_file:
FileNotFoundError: [Errno 2] No such file or directory: 'data_opts/b_0_4.json'

An alternative would be to be able to remove these Tensorflow warnings from a CLI argument.

What I suggest is one of these options:

What do you think about this idea?