Chainerでの機械学習の実装中でしたが、コマンドプロンプトでpython train_imagenet.py -g 0 --train train.txt --val test.txtと打ち込んだ際にエラーが出てしまいました。
初歩的な問題だと思いますがどうかよろしくお願いします。
実現したいこと
ここに実現したいことを箇条書きで書いてください。
- 今出ているエラーの解決
発生している問題・エラーメッセージ
エラーメッセージ ```Traceback (most recent call last): File "train_imagenet.py", line 102, in <module> model = nin.NIN() File "C:\Users\owner\実験データ\20201114\nin.py", line 18, in __init__ 3, (96, 96, 96), 11, stride=4, wscale=w), File "C:\Users\owner\AppData\Roaming\Python\Python37\site-packages\chainer\links\connection\mlp_convolution_2d.py", line 77, in __init__ argument.check_unexpected_kwargs(kwargs, wscale=msg) File "C:\Users\owner\AppData\Roaming\Python\Python37\site-packages\chainer\utils\argument.py", line 7, in check_unexpected_kwargs raise ValueError(message) ValueError: wscale is not supported anymore. Use conv_init and bias_init argument to change the scale of initial parameters. ### 該当のソースコード ```ここに言語を入力 python コード nin.py import math import chainer import chainer.functions as F import chainer.links as L class NIN(chainer.Chain): """Network-in-Network example model.""" insize = 227 def __init__(self): w = math.sqrt(2) # MSRA scaling super(NIN, self).__init__( mlpconv1=L.MLPConvolution2D( 3, (96, 96, 96), 11, stride=4, wscale=w), mlpconv2=L.MLPConvolution2D( 96, (256, 256, 256), 5, pad=2, wscale=w), mlpconv3=L.MLPConvolution2D( 256, (384, 384, 384), 3, pad=1, wscale=w), mlpconv4=L.MLPConvolution2D( 384, (1024, 1024, 1000), 3, pad=1, wscale=w), ) self.train = True def clear(self): self.loss = None self.accuracy = None
Chainer v2で削除されてる機能を使ってるので、質問者さんが参考にしてるコードがかなり古いのではないですかね
https://docs.chainer.org/en/latest/upgrade_v2.html#wscale-option-is-removed-from-links
回答1件
あなたの回答
tips
プレビュー