OpenMythosのサンプルプログラムを動かしました

1.概要 前回、OpenMythosの環境構築まで実現したので、GitHubにあるサンプルプログラム(Usage)を動かしてみました。一部エラーが発生しましたが、結果出力部分なので修正をしました。その内容を記述します。 2.詳細 Usageに記載されているPythonプログラムをopenmythos_usage.pyとして作成します。 $ source ~/mypy/bin/activate (mypy) $ pythoh3 openmythos_usage.py 下記エラーとなります [MLA] Parameters: 1,538,626 [MLA] Logits shape: torch.Size([2, 16, 1000]) [MLA] Generated shape: torch.Size([2, 24]) Traceback (most recent call last):   File "/home/nakasima/openmythos/openmythos_usage.py", line 48, in <module>     rho = torch.linalg.eigvals(A).abs().max().item()           ^^^^^^^^^^^^^^^^^^^^^^^ RuntimeError: linalg.eig: The input tensor A must have at least 2 dimensions. コードの下記部分を修正します #rho = torch.linalg.eigvals(A).abs().max().item() rho = A.abs().max().item() $ source ~/mypy/bin/activate (mypy) $ pythoh3 openmythos_usage.py [MLA] Parameters: 1,538,626 [MLA] Logits shape: torch.Size([2, 16, 1000]) [MLA] Generated shape: torch.Size([2, 24]) [MLA] Spectral radius ρ(A) = 0.3679 (mus...

Google Driveでinotify-toolが利用できないか試しました

1.概要

inotify-toolのinotifywaitをGoogle Driveで利用できないかと考えて試してみました。inotifywaitのオプションを設定して、リカーシブに検知を設定してもGoogle Driveでは検知できません。しかし、単一ファイルならば検知できました。その内容を記述します。

2.詳細

inotifywaitには、-rのオプションを設定することでリカーシブに検知できます。これはLocalPCで確認をしました。そこで、Google DriveをGoogle-drive-ocamlfuseでmountして、リカーシブに検知できないか期待して試しました。

(a) Google Drive mount

google-drive-ocamlfuse ~/sharedrive

(b) ファイル検知設定

inotifywait -m -r ~/sharedrive -e close_write |
    while read -r directory action file
    do
        echo "$directory, $action, $file"
    done

検知用shell(test.sh)を実行します

sh test.sh
Setting up watches.
Watches established.
と表示されて止まります。

別のterminalを開いて、何かファイルを作成します。

cd ~/sharedrive
touche test.txt
しかし、検知されません。

(c) 1つのファイル検知試験

inotifywait -m ~/sharedrive/testfile.txt -e close_write |
    while read -r directory action file
    do
        echo "$directory, $action, $file"
    done

検知用shell(test.sh)を実行します

sh test.sh
Setting up watches.
Watches established.
と表示されて止まります。

cd ~/sharedrive
touche testfile.txt
これは検知できました。機能しているようです。

所見

理由はわかりませんが、大量なファイルが保管されているGoogle Drive全体の検知は難しいようです。

参考
[本ブログ内参照]
・ファイル作成を検知するinotify-toolsを試しました
・Google driveのアクセス方法の試験 google-drive-ocamlfuse編

コメント

このブログの人気の投稿

miniPCのBMAXでWindows11のsecure boot設定漏れでトラブル発生

LinuxMint-22.3にWine 11.6をサクッと入れてみました

LinuxMint 21.3にWinBoat導入を試してみました