google / model_search

Apache License 2.0
3.26k stars 462 forks source link

RuntimeError: Cannot connect sqlite3 database: unable to open database file #53

Closed Raketenpete closed 3 years ago

Raketenpete commented 3 years ago

To get started, I just ran the example code. Unfortunately I get a RuntimeError. Did anyone get the same error or has an idea to solve it? Thanks in advance!

============================CODE OUTPUT========================================

2021-04-15 08:37:31.183727: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cudart64_101.dll'; dlerror: cudart64_101.dll not found
2021-04-15 08:37:31.184042: 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.
Traceback (most recent call last):
  File "demo.py", line 55, in <module>
    experiment_owner="model_search_user")
  File "C:\...\model_search\model_search\single_trainer.py", line 65, in try_models
    metadata=None)
  File "C:\...t\model_search\model_search\phoenix.py", line 240, in __init__
    study_owner)
  File "C:\...\model_search\model_search\metadata\ml_metadata_db.py", line 105, in __init__
    self._store = metadata_store.MetadataStore(self._connection_config)
  File "C:\...7\AppData\Local\Programs\Python\Python37\lib\site-packages\ml_metadata\metadata_store\metadata_store.py", line 92, in __init__
    config.SerializeToString(), migration_options.SerializeToString())
RuntimeError: Cannot connect sqlite3 database: unable to open database file

EDIT1: Formating EDIT2: Changed VENV from python 3.7 to python 3.8 but didn't solve the problem

aprikyan commented 3 years ago

This one worked for me:

I found the problem and solved it. I made directory name like "c:/tmp/filedb-352355" 352355 is random value from 0 to 1000000. (We can find this code in ml_metadata_db.py line 102)

Running started... I wish this tips is helpful.

_Originally posted by @KevinRyu in https://github.com/google/model_search/issues/31#issuecomment-790503282_

Raketenpete commented 3 years ago

This with

`# Addresses `UnrecognizedFlagError: Unknown command line flag 'f'`
sys.argv = sys.argv[:1]
# `app.run` calls `sys.exit`
try:
    app.run(lambda argv: None)
except:
    pass`

between import and trainer =.... solved it for me!

Thanks @aprikyan !!

EDIT1: Formatting