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))
app_cls = importstr(*app.rsplit('.', 1)) #
app_cls(argv).main()
[log.info](http://log.info/)(Finished: {}.{!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の理解と今後の導入ができず困っております。もしできますならばエラーの解消法をご教授いただきたく存じます。また、この場合にキャッシュの作成について具体的かつ有効な作成法がありましたら、申し訳ありませんが例などを示していただけると非常に有り難いです。
よろしくお願いいたします。
それでは失礼しました。