generatebio/chroma

fileNotFound error

ecass777 opened this issue · 6 comments

I installed chroma in a conda environment. I registered the API key via this code:

from chroma.utility.api import register_key
register_key("[mytoken]")

When I try to run a simple program such as:
from chroma import Chroma

chroma = Chroma()

I receive this error message:

Using cached data from C:\Users\Elijah\AppData\Local\Temp\chroma_weights\90e339502ae6b372797414167ce5a632\weights.pt
Computing reference stats for 2g3n
Traceback (most recent call last):
File "C:\Users\Elijah\DataspellProjects\pythonProject\chroma1.py", line 3, in
chroma = Chroma()
File "C:\ProgramData\anaconda3\envs\pdbs\lib\site-packages\chroma\models\chroma.py", line 84, in init
self.backbone_network = graph_backbone.load_model(
File "C:\ProgramData\anaconda3\envs\pdbs\lib\site-packages\chroma\models\graph_backbone.py", line 405, in load_model
return utility_load_model(
File "C:\ProgramData\anaconda3\envs\pdbs\lib\site-packages\chroma\utility\model.py", line 107, in load_model
model = model_class(**params["init_kwargs"]).to(device)
File "C:\ProgramData\anaconda3\envs\pdbs\lib\site-packages\chroma\models\graph_backbone.py", line 114, in init
[
File "C:\ProgramData\anaconda3\envs\pdbs\lib\site-packages\chroma\models\graph_backbone.py", line 115, in
BackboneEncoderGNN(
File "C:\ProgramData\anaconda3\envs\pdbs\lib\site-packages\chroma\models\graph_design.py", line 1192, in init
self.feature_graph = protein_graph.ProteinFeatureGraph(
File "C:\ProgramData\anaconda3\envs\pdbs\lib\site-packages\chroma\layers\structure\protein_graph.py", line 182, in init
self._load_centering_params(self.centered_pdb)
File "C:\ProgramData\anaconda3\envs\pdbs\lib\site-packages\chroma\layers\structure\protein_graph.py", line 276, in _load_centering_params
param_dictionary = self._reference_stats(reference_pdb)
File "C:\ProgramData\anaconda3\envs\pdbs\lib\site-packages\chroma\layers\structure\protein_graph.py", line 294, in _reference_stats
X, C, _ = Protein.from_PDBID(reference_pdb).to_XCS()
File "C:\ProgramData\anaconda3\envs\pdbs\lib\site-packages\chroma\data\protein.py", line 234, in from_PDBID
RCSB_file_download(pdb_id, ".cif", file_cif)
File "C:\ProgramData\anaconda3\envs\pdbs\lib\site-packages\chroma\utility\fetchdb.py", line 47, in RCSB_file_download
return _download_file(url, local_filename)
File "C:\ProgramData\anaconda3\envs\pdbs\lib\site-packages\chroma\utility\fetchdb.py", line 27, in _download_file
with open(out_file, "wb") as f:
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/2g3n.cif'

Did I not register the API key correctly, or is this another issue such as it being in a conda environment?

Hey, Can you check first you if have the permission to write to /tmp/? I think RCSB_file_download failed silently due to lack of write permission.

Oh, we just realized you are on Windows, and /tmp/ probably does not exist
on windows. Will figure out something.

Okay thanks. Yea I wasn't sure if that was the problem. I was trying to look at file paths, but I didn't want to mess with them and screw anything up.

While we are working on taking out hard coded path, you can also try Windows Subsystem for Windows to have a local linux environment.

Hi! We pushed a fix which should help with the temporary directory issue on Windows. Would you be able to pull and try again?

@ecass777 Hey, close this issue for now due to inactivity, but feel free to reopen if you need more assitance.