-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
11章のassortionerror発生について #23
Comments
biomania2021様 ご質問いただきありがとうございます。 以下の実行結果を見るにキャッシュを作成するためのデータが存在していないようです
元データの取得と解凍がうまくいっていない可能性があります。データの配置等を確認いただくことは可能でしょうか。うまくいくと以下のような表記になります。
|
GIn5050様 precacheについて、解決に的確なアドバイスいただきありがとうございました。 ただ、続く from util.util import importstr def run(app, *argv):
run('p2ch11.training.LunaTrainingApp', '--epochs=1') 実行結果
|
GIn5050様 また、もう一つの回答をいただいた件からgoogle colabのディスク限界に対応するため、subsetを0,1,2,3,4のみとしてキャッシュを作成(成功)して再度下記をGPU標準の設定で from util.util import importstr def run(app, *argv): app_cls = importstr(*app.rsplit('.', 1)) # <2> log.info("Finished: {}.{!r}).main()".format(app, argv)) 2022-11-14 08:37:57,323 INFO pid:1084 nb:011:run Running: p2ch11.training.LunaTrainingApp(['--num-workers=4', '--epochs=1']).main() ただ、続く 2022-11-14 09:56:01,788 INFO pid:1994 main:079:initModel Using CUDA; 1 devices. とのように、前回と同様のエラーが生じておりました。 ご多忙な中お手数取らせてしまい誠に申し訳ありませんが、 |
biomania2021 様 回答が遅くなり大変申し訳ございません。 現在、biomania2021 様が実施されている処理は本書の11.7(P372)記載の内容だと理解してます。 上記の条件のもとsubset0のみを用いた場合ですと、正常に実行が終わることを確認しました。 よろしくお願いいたします |
GIn5050様 ご回答のとおり、subset0のみにして実行したところ正常に実行が終了しました。 この度はgoogle colabを使用して実行しておりましたが、より安定かつ大容量のデータの解析を行うべく以前にお教えいただいたとおり、コストはある程度覚悟する必要がありますがローカルで実行可能なマシン構築もしくはクラウド上でVMの使用を検討したいと思います。 ご多忙な中お手数掛けまして申し訳ありませんでした。 |
11章の11.2のプログラムの実行方法及び、11.7の訓練の実施において
どちらも実行後にassortionerrorが出て進むことができずにおります。
こちらの11章の質問などを参考にして多数実行しましたが解決できないため
誠に申し訳ありませんがこちらに質問させていただくことになりました。
現在の私のPC等環境
PCスペック
プロセッサー:Intel Corei7-9700K CPU @ 3.60Ghz * 8
グラフィック NVIDIA Corporation GP106[GeForce GTX 1060 6Gb]
メモリ 16Gb
OS:Ubuntu22.04.1LTS 64ビット
GNOMEバージョン 42.4
使用環境
GoogleColaboratory
googledriveに必要データ等保存し、マウントして実行
ネット環境はフレッツ光なので通信速度は問題ないと思われます。
実行過程(以下をgoogle colabで実行)
googleドライブのgoogle colabへのマウント
from google.colab import drive
drive.mount('/content/drive')
カレントデイレクトリの移動
import os
_colab_dir = /content/drive/MyDrive/pytorch/deep-learning-with-pytorch-ja/
os.chdir(_colab_dir)
実行結果
カレントワーキングディレクトリは[/content/drive/MyDrive/pytorch/deep-learning-with-pytorch-ja]です
requirements.txtに書かれてた必要ライブラリ等のインストール
!pip install blosc
!pip install jupyter
!pip install SimpleITK
!pip install diskcache
!pip install cassandra-driver
キャッシュの事前準備のためp2ch11.prepcacheの実行
!python -m p2ch11.prepcache
実行結果
2022-10-24 06:41:13,508 INFO pid:385 main:043:main Starting LunaPrepCacheApp, Namespace(batch_size=1024, num_workers=2)
2022-10-24 06:41:16,716 INFO pid:385 p2ch11.dsets:185:init : 0 training samples
2022-10-24 06:41:16,716 WARNING pid:385 util.util:221:enumerateWithEstimate Stuffing cache ----/0, starting
2022-10-24 06:41:17,417 WARNING pid:385 util.util:252:enumerateWithEstimate Stuffing cache ----/0, done at 2022-10-24 06:41:17
プログラムの実行結果の実行
import datetime
from util.util import importstr
from util.logconf import logging
log = logging.getLogger('nb')
def run(app, *argv):
argv = list(argv)
argv.insert(0, '--num-workers=4') #
log.info(Running: {}({!r}).main().format(app, argv))
run('p2ch11.training.LunaTrainingApp', '--epochs=1')
実行結果
AssertionError Traceback (most recent call last)
in
15 log.info(Finished: {}.{!r}).main().format(app, argv))
16
---> 17 run('p2ch11.training.LunaTrainingApp', '--epochs=1')
18
19
3 frames
/content/drive/MyDrive/pytorch/deep-learning-with-pytorch-ja/p2ch11/dsets.py in init(self, val_stride, isValSet_bool, series_uid, sortby_str)
169 elif val_stride > 0:
170 del self.candidateInfo_list[::val_stride]
--> 171 assert self.candidateInfo_list
172
173 if sortby_str == 'random':
AssertionError:
p2ch11.trainingの実行
!python -m p2ch11.training
実行結果
2022-10-24 06:42:10,608 INFO pid:486 main:079:initModel Using CUDA; 1 devices.
2022-10-24 06:42:12,257 INFO pid:486 main:138:main Starting LunaTrainingApp, Namespace(batch_size=32, comment='dwlpt', epochs=1, num_workers=2, tb_prefix='p2ch11')
Traceback (most recent call last):
File /usr/lib/python3.7/runpy.py, line 193, in _run_module_as_main
main, mod_spec)
File /usr/lib/python3.7/runpy.py, line 85, in _run_code
exec(code, run_globals)
File /content/drive/MyDrive/pytorch/deep-learning-with-pytorch-ja/p2ch11/training.py, line 387, in
LunaTrainingApp().main()
File /content/drive/MyDrive/pytorch/deep-learning-with-pytorch-ja/p2ch11/training.py, line 140, in main
train_dl = self.initTrainDl()
File /content/drive/MyDrive/pytorch/deep-learning-with-pytorch-ja/p2ch11/training.py, line 92, in initTrainDl
isValSet_bool=False,
File /content/drive/MyDrive/pytorch/deep-learning-with-pytorch-ja/p2ch11/dsets.py, line 171, in init
assert self.candidateInfo_list
AssertionError
以上のように、assertionErrorの発生のため実行できずにおります。
prepcacheを実行しているのにキャッシュを作成しているはず?なのにエラーが解消しないため、ここから進めずpytorchの理解と今後の導入ができず困っております。もしできますならばエラーの解消法をご教授いただきたく存じます。また、この場合にキャッシュの作成について具体的かつ有効な作成法がありましたら、申し訳ありませんが例などを示していただけると非常に有り難いです。
よろしくお願いいたします。
それでは失礼しました。
The text was updated successfully, but these errors were encountered: