<朗報!> StarNet2は、M1 MacのPixInsightで動きます!

M1 Max搭載のMacBook ProでPixInsightからStar Net2を起動

長らくM1 Macユーザを苦しめていた「StarNetがM1 MacのPixInsightで動かない問題」。ついに解決されました!嬉しすぎる。これまではコマンドラインからの実行は可能でしたが、PixInsightのメニューからは実行できませんでした。問題はTensorFlowのライブラリがM1に対応していないこと。StarNet2では、なんとM1対応のTensorFlowライブラリが同梱されています。

インストール方法はCloudy Nightsのこちらのスレッドを拝見しました。下記のインストール方法もこの記事をもとにしています。

StarNet2のダウンロード

こちらのサイトから、Fresh Install: StarNet2_MacOS_2.1.0_tf_x64_install.zipをダウンロードします。ダウンロードしたzipファイルはダウンロードフォルダに入れておいてください。

StarNetのインストール

MacのLaunchpadの「その他」の中にあるターミナルを立ち上げ、次のコマンドを1行ずつ実行します。

cd $HOME/Downloads
unzip -o StarNet2_MacOS_2.1.0_tf_x64_install.zip
cd StarNet2_MacOS_2.1.0_tf_x64_install

sudo cp StarNet2_weights.pb /Applications/PixInsight/lib/
sudo chown root:admin /Applications/PixInsight/lib/StarNet2_weights.pb
sudo chmod 644 /Applications/PixInsight/lib/StarNet2_weights.pb

sudo cp StarNet2-pxm.dylib /Applications/PixInsight/bin/
sudo chown root:admin /Applications/PixInsight/bin/StarNet2-pxm.dylib
sudo chmod 755 /Applications/PixInsight/bin/StarNet2-pxm.dylib

sudo rm -f /Applications/PixInsight/bin/libtensorflow*
sudo cp libtensorflow* /Applications/PixInsight/PixInsight.app/Contents/Frameworks/
sudo chown root:admin /Applications/PixInsight/PixInsight.app/Contents/Frameworks/libtensorflow*
sudo chmod 755 /Applications/PixInsight/PixInsight.app/Contents/Frameworks/libtensorflow*

sudo xattr -dr com.apple.quarantine /Applications/PixInsight/bin/StarNet2-pxm.dylib

(Cloudy Nightsの下記スレッドより転載。2023.06.27最新のファイル名に修正)
https://www.cloudynights.com/topic/808556-starnet-v2/?p=11671654

上記の長い行は改行して2行に見えるかもしれませんが、4行目以降は全て”sudo”から始まる行が先頭行ですので、お間違いなく。

StarNet2の登録

PixInsightからStarNet2が利用できるように登録します。

  1. Process – ModulesメニューからInstall Modules…を実行
  2. Searchボタンを押す
  3. 検索されたStarNet2を選択してInstallを実行

Installが終了すると、Process – <All Processes>の中にStarNet2が登録されます。

いや〜。長かった!次はPixInsightがM1にネイティブ対応するのが待たれますね

追記 (2022.4.9) エラーの回避

PixInsightをアップデートしたらStarNet2がメニューから消えたため、同じ手順で再インストールしました。すると下記のエラーが出てしまいました。

Could not find checkpoint file in ‘/Applications/PixInsight/bin/’!

アプリケーションフォルダのPixInsight/Libの下にある”StarNet2_weights.pb”ファイルを、PixInsight/binの下にコピーしたらエラーがなくなり動作しました。もし同じエラーがある方はお試しください。

タイトルとURLをコピーしました