Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
richelbilderbeek opened this issue Jun 28, 2021 · 0 comments
Open

Comments

@richelbilderbeek
Copy link
Contributor

richelbilderbeek commented Jun 28, 2021

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:

  • Load Tensorflow after checking the CLI arguments
  • Add the ubiquitous --verbose argument and only show the Tensorflow things when it is enabled

What do you think about this idea?

@richelbilderbeek richelbilderbeek changed the title Shorter error message when --datadir is not found Suggest: Shorter error message when --datadir is not found Jun 29, 2021
@richelbilderbeek richelbilderbeek changed the title Suggest: Shorter error message when --datadir is not found Suggest: shorter error message when --datadir is not found Jun 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant