実現したいこと
img2molを利用できるようにする
発生している問題・分からないこと
img2molというソフトをインストールし、実行しようとしたがインポートでエラーが出ている。
エラーメッセージ
error
1C:\anaconda3\envs\img2mol\lib\site-packages\tqdm\auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html 2 from .autonotebook import tqdm as notebook_tqdm 3Local CDDD installation has not been found. 4C:\anaconda3\envs\img2mol\lib\site-packages\torch\cuda\__init__.py:52: UserWarning: CUDA initialization: Found no NVIDIA driver on your system. Please check that you have an NVIDIA GPU and installed a driver from http://www.nvidia.com/Download/index.aspx (Triggered internally at ..\c10\cuda\CUDAFunctions.cpp:100.) 5 return torch._C._cuda_getDeviceCount() > 0 6from IPython.display import display 7
該当のソースコード
import torch from img2mol.inference import * from IPython.display import display
試したこと・調べたこと
- teratailやGoogle等で検索した
- ソースコードを自分なりに変更した
- 知人に聞いた
- その他
上記の詳細・結果
バージョンが違うかどうか確認したが、githubに記載されているバージョンと同じであった。
補足
特になし
errorではなくwarningなので、import はできているのではないでしょうか(importできても使えない状態かもしれません)。
warningに書かれている、jupyter と ipywidgets のアップデートや、CUDA の環境については確認しましたか?
"Local CDDD installation has not been found" というメッセージが表示されていますが、これは以下の部分になります。
Img2Mol/img2mol/inference.py at main · bayer-science-for-a-better-life/Img2Mol
https://github.com/bayer-science-for-a-better-life/Img2Mol/blob/main/img2mol/inference.py#L35
ソースコードのコメントにある通り、CDDD モジュールから InferenceModel がインポート可能であれば利用するということなので問題はなさそうです。
https://github.com/bayer-science-for-a-better-life/Img2Mol/blob/main/img2mol/inference.py#L29
# CDDD import only works if the suitable environment has been installed
https://github.com/bayer-science-for-a-better-life/Img2Mol/blob/main/img2mol/inference.py#L58
if local_cddd:
self.cddd_inference_model = CDDDInferenceModel()
else:
self.cddd_inference_model = None
実際にはエラーは発生していないのではないでしょうか。
コメントありがとうございます。助かります。
「ローカル CDDD インストールが見つかりませんでした」というメッセージは適切な環境がインストールされていないため表示されているということでしょうか?
upyterとipywidgetsのアップデートや、CUDAの環境を確認することで、warningは無くなると思われますか?
> 「ローカル CDDD インストールが見つかりませんでした」というメッセージは適切な環境がインストールされていないため表示されているということでしょうか?
適切な環境というよりは、「CDDD がインストールされていないので cddd.inference(CDDD InferenceModel) は利用しません(利用できません)」という意味かと思います。
jrwnter/cddd: Implementation of the Paper "Learning Continuous and Data-Driven Molecular Descriptors by Translating Equivalent Chemical Representations" by Robin Winter, Floriane Montanari, Frank Noe and Djork-Arne Clevert.
https://github.com/jrwnter/cddd
> upyterとipywidgetsのアップデートや、CUDAの環境を確認することで、warningは無くなると思われますか?
確認した結果問題があれば対処が必要です。少なくともNvidia GPU が搭載されていてドライバーがインストールされていないと消えないです。(warningなので、GPUがなくても動くように作られているのかもしれませんが)
ありがとうございます。参考になります。
NvidiaのGPUは搭載されていないため諦めます。
次の処理 res = img2mol(filepath="examples/digital_example1.png", cddd_server=cddd_server)において、
ConnectionError: HTTPConnectionPool(host='ec2-18-157-240-87.eu-central-1.compute.amazonaws.com', port=8892): Max retries exceeded with url: /cddd_to_smiles/ (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x0000022D9FF0FDF0>: Failed to establish a new connection: [WinError 10060] 接続済みの呼び出し先が一定の時間を過ぎても正しく応答しなかったため、接続できませんでした。または接続済みのホストが応答しなかったため、確立された接続は失敗しました。'))
とエラーが出てしまうのですが、これはcdddがインストールされていないからでしょうか?cdddをインストールする必要がありますか?
> ConnectionError: HTTPConnectionPool(host='ec2-18-157-240-87.eu-central-1.compute.amazonaws.com', port=8892): Max retries exceeded with url:
> これはcdddがインストールされていないからでしょうか?
このホスト/ポートに対して tcptraceroute を実行してみたのですが、Destination not reached になってしまいます。
$ tcptraceroute ec2-18-157-240-87.eu-central-1.compute.amazonaws.com 8892
Tracing the path to ec2-18-157-240-87.eu-central-1.compute.amazonaws.com (18.157.240.87) on TCP port 8892, 30 hops max
:
8 * * *
9 ae-37.a02.osakjp02.jp.bb.gin.ntt.net (203.105.64.41) 50.719 ms 52.243 ms 30.297 ms
10 ae-1.r26.osakjp02.jp.bb.gin.ntt.net (129.250.4.233) 41.375 ms 62.757 ms 55.513 ms
11 * * *
12 * * *
13 ae-3.r23.parsfr04.fr.bb.gin.ntt.net (129.250.6.5) 321.141 ms 294.334 ms 288.826 ms
14 * ae-8.a01.parsfr04.fr.bb.gin.ntt.net (129.250.4.94) 301.681 ms 299.999 ms
15 ae-1.amazon.parsfr04.fr.bb.gin.ntt.net (128.241.4.66) 317.942 ms 327.634 ms 308.067 ms
16 * * *
:
Destination not reached
そのコードはおそらく以下の Jupyter Notebook の一部かと思いますが、3年前に作成されたものなので、上記の CDDB サーバは現在では動作していないのかもしれません。なので、cddd をインストールしても結果は同じになるかと思います。
Img2Mol/example_inference.ipynb at main · bayer-science-for-a-better-life/Img2Mol
https://github.com/bayer-science-for-a-better-life/Img2Mol/blob/main/example_inference.ipynb
すみません、詳しく教えていただきありがとうございます。
サーバが動作していない可能性があるのですね。サーバが動作していない場合、解決策は特にないということでしょうか?
README.md の Download Model Weights に、モデルファイルをローカル環境にダウンロードして実行する方法が書かれています。
Download Model Weights
https://github.com/bayer-science-for-a-better-life/Img2Mol/tree/main#download-model-weights
また、次の Exmaples では、
> A demonstration of the usage with the usage with the local CDDD model is demonstrated in example_inference_local_cddd.ipynb.
と書かれていますので、この example_inference_local_cddd.ipynb で試してみてはどうでしょうか。
ありがとうございます。
ベストアンサーに選びたいので同じ内容を回答欄に投稿いただけますでしょうか?

回答1件
あなたの回答
tips
プレビュー