google / model_search

Apache License 2.0
3.26k stars 462 forks source link

Cannot connect sqlite3 database #27

Closed j850613enna closed 3 years ago

j850613enna commented 3 years ago

Hi,

I cannot connect to database while running the “Getting started” example. How can I fix this? Thank you.

Here is the full trace:

Traceback (most recent call last):

  File "C:\Users\e173196\Anaconda projects\model_search\load_flags.py", line 32, in <module>

    trainer.try_models(

  File "C:\Users\e173196\Anaconda projects\model_search\model_search\single_trainer.py", line 57, in try_models

    phoenix_instance = phoenix.Phoenix(

  File "C:\Users\e173196\Anaconda projects\model_search\model_search\phoenix.py", line 239, in __init__

    self._metadata = ml_metadata_db.MLMetaData(phoenix_spec, study_name,

  File "C:\Users\e173196\Anaconda projects\model_search\model_search\metadata\ml_metadata_db.py", line 100, in __init__

    self._store = metadata_store.MetadataStore(self._connection_config)

  File "C:\Users\e173196\Anaconda3\envs\Model_search\lib\site-packages\ml_metadata\metadata_store\metadata_store.py", line 91, in __init__

    self._metadata_store = metadata_store_serialized.CreateMetadataStore(

RuntimeError: Cannot connect sqlite3 database: unable to open database file
KevinRyu commented 3 years ago

I also have this problem. Is it solved?

sychotixdev commented 3 years ago

I just fixed this problem on my end by creating root_dir passed into try_models. /tmp/run_example/ is C:/tmp/run_example/ in my case. You could also change this parameter to an existing directory.

KevinRyu commented 3 years ago

I just fixed this problem on my end by creating root_dir passed into try_models. /tmp/run_example/ is C:/tmp/run_example/ in my case. You could also change this parameter to an existing directory.

Hello. You did a nice job. Kudos to you! Thank you very much!

j850613enna commented 3 years ago

I just fixed this problem on my end by creating root_dir passed into try_models. /tmp/run_example/ is C:/tmp/run_example/ in my case. You could also change this parameter to an existing directory.

It works. Thank you so much.

ditopcu commented 3 years ago

I do not understand the solution. Could you please explain? Thanks

sychotixdev commented 3 years ago

I do not understand the solution. Could you please explain? Thanks

Make sure the root_dir parameter points to a directory that actually exists. In the default example, the value is "/tmp/run_example". On my PC, this points to "C:/tmp/run_example", so I needed to create both the tmp and run_example directories.