本家様 http://sphire.mpg.de/wiki/doku.php?id=auto_2d_class_selection

Automatic 2D class selection

インストール

まずはpyenv環境を構築するcrYOLO#w789c07e
その次に
Cinderella 向けの仮想実行環境を作る

[root@c ~]# conda create -n cinderella -c anaconda python=3.6 pyqt=5 cudnn=7.1.2
 
[root@c ~]# source activate cinderella
               
(cinderella) [root@c ~]# conda install numpy==1.15.4
(cinderella) [root@c ~]# pip install cinderella[gpu]
 
(cinderella) [root@c ~]# which sp_cinderella_predict.py
/Appl/pyenv/versions/anaconda3-5.3.1/envs/cinderella/bin/sp_cinderella_predict.py
(cinderella) [root@c ~]#
 
(cinderella) [root@c ~]# conda deactivate
[root@c ~]#

留意
「sp_cinderella_predict.py」と実行して
AttributeError: module 'tensorflow.python.keras.backend' has no attribute 'get_graph'」と出るなら
「keras」も入れると治るかも

(cinderella) [root@c ~]# pip install keras==2.2.0

スクリプト

cinderella環境に移行しやすくするためにスクリプトを組んでみた

export PYENV_ROOT=/Appl/pyenv
export PATH=$PYENV_ROOT/bin:$PATH
eval "$(pyenv init - --no-rehash)"
export PATH=$PYENV_ROOT/versions/anaconda3-5.3.1/bin/:$PATH
 
source activate cinderella

これを「/Appl/local/bin/cinderella」として保存して chmod +x にする。
そして

alias Cinderella='eval source /Appl/local/bin/cinderella'
alias deCinderella='conda deactivate'

を.bashrcに加える。これで

[saber@c ~]$ Cinderella
(cinderella) [saber@c ~]$
(cinderella) [saber@c ~]$ deCinderella
[saber@c ~]$

とコマンド一つで環境に移れる

■csh/tcshユーザの場合
crYOLO#n9c7ad00から

[bar@c ~]$ setenv CONDA_ENVS_PATH /Appl/pyenv/versions/anaconda3-5.3.1/envs
[bar@c ~]$ source /Appl/local/bin/activate.csh  cinderella
(cinderella)[bar@c ~]$
 
(cinderella)[bar@c ~]$ source /Appl/local/bin/deactivate.csh
[bar@c ~]$

とすることで使える
bashのように単一コマンドにできなかった....

EnvironmentModules

EnvironmentModulesで実行環境を整備するならmodiilefileを下記のようにする
*普通は「/etc/modulefiles/cinderella」かな

[root@c ~]# vi /home/Common/modules/cinderella 
#%Module -*- tcl -*-
 
proc ModulesHelp { } {
  puts stderr "\tAdds anaconda to your environment variables,"
}
module-whatis "Adds anaconda to your environment variables"
set          root /Appl/pyenv/versions/anaconda3-5.3.1/envs/cinderella
prepend-path PATH $root/bin
[root@c ~]#

ロード方法は「module load cinderella」

使い方

参照http://sphire.mpg.de/wiki/doku.php?id=auto2d_tutorial

Pretrained modelが提供されているので、それを取得します。

「relion30_tutorial_precalculated_results/Class2D/job008」を使ってみた

(cinderella) [saber@c cinderella]$ sp_cinderella_predict.py -i run_it025_classes.mrcs -w /Appl/cinderella/model_cinderella_20190708.h5 -o out/ -t 0.7 --gpu 1
Using TensorFlow backend.
2019-09-13 00:40:33.505544: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2019-09-13 00:40:33.518586: E tensorflow/stream_executor/cuda/cuda_driver.cc:397] failed call to cuInit: CUDA_ERROR_NO_DEVICE
2019-09-13 00:40:33.519113: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:163] retrieving CUDA diagnostic information for host: c.sybyl.local
2019-09-13 00:40:33.519131: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:170] hostname: c.sybyl.local
2019-09-13 00:40:33.519178: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:194] libcuda reported version is: 418.39.0
2019-09-13 00:40:33.519230: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:198] kernel reported version is: 418.39.0
2019-09-13 00:40:33.519244: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:305] kernel version seems to match DSO: 418.39.0
Model: "model_2"
_________________________________________________________________
Layer (type)                 Output Shape              Param #
=================================================================
input_1 (InputLayer)         (None, 75, 75, 1)         0
_________________________________________________________________
model_1 (Model)              (None, 4, 4, 1024)        50646432
_________________________________________________________________
global_average_pooling2d_1 ( (None, 1024)              0
_________________________________________________________________
denseL1 (Dense)              (None, 64)                65600
_________________________________________________________________
denseL2 (Dense)              (None, 10)                650
_________________________________________________________________
denseL3 (Dense)              (None, 1)                 11
=================================================================
Total params: 50,712,693
Trainable params: 50,691,637
Non-trainable params: 21,056
_________________________________________________________________
2019-09-13 00:40:37.687003: W tensorflow/core/framework/allocator.cc:108] Allocation of 37748736 exceeds 10% of system memory.
2019-09-13 00:40:37.687099: W tensorflow/core/framework/allocator.cc:108] Allocation of 37748736 exceeds 10% of system memory.
2019-09-13 00:40:37.728333: W tensorflow/core/framework/allocator.cc:108] Allocation of 47185920 exceeds 10% of system memory.
2019-09-13 00:40:37.808678: W tensorflow/core/framework/allocator.cc:108] Allocation of 37748736 exceeds 10% of system memory.
2019-09-13 00:40:37.826402: W tensorflow/core/framework/allocator.cc:108] Allocation of 37748736 exceeds 10% of system memory.
Try to list images on run_it025_classes.mrcs
100%|????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????| 2/2 [00:01<00:00,  1.94it/s]
 
 Good classes:  2 / 50 ( 4 % )
 
 
 Bad classes:  48 / 50 ( 96 % )
 
(cinderella) [saber@c cinderella]$

「relion_display --gui」でoutputのファイルを開いてみる。


トップ   編集 添付 複製 名前変更     ヘルプ   最終更新のRSS
Last-modified: 2019-12-06 (金) 23:33:10 (9d)