jjjkkkjjj / pytorch.dl Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
こんばんわ、先日も質問した者です。
無事学習を進めることができ、公開されている重みを使用して転移学習をしております。
しかし、手元の300枚のデータを学習させたところ下のようなlossになりました。
同じような画像のデータセットで学習させ、trainデータセットと同じようなtest画像に推論をさせたいので、正直過学習してもいいのですが、検出精度だけ非常に悪いです。
使用しているコードは公開されているgithubのデータセットと保存のパスだけ変更して使用しております。
これはやはりデータセットの作成方法に起因しているのでしょうか。
作成したデータセットの矩形はそこまでタイトにしておりません。
データのすべてのxmlファイルについて画像に矩形を表示して確認しましたがきちんと文字をとっており、左上スタートになっておりました。
For improvement, each task's DatasetBase should be Mixin instead of class.
If so, the dataset can support multi task.
こんばんは、こちらのコードを拝借して転移学習を試みておりますが学習がうまくいかないため質問させてください。
学習にはdebug/fots/train.pyを使用し、モデルの読み込みの下に以下のコードを入れて実行しております。
model.load_weights('./sample_weights/fots-pretrain_model.pth')
エラーはpytorchのctc_lossで起きております。
Traceback (most recent call last):
File "train.py", line 66, in <module>
trainer.train_epoch(save_manager, 10, train_loader)
File "C:\Users\kd207\Desktop\gleap\ocr\torchdl\dl\log\trainer.py", line 95, in train_epoch
self._train(savemanager, max_iterations, train_loader, start_iteration)
File "C:\Users\kd207\Desktop\gleap\ocr\torchdl\dl\log\trainer.py", line 123, in _train
names, losses = self.learn(*item)
File "C:\Users\kd207\Desktop\gleap\ocr\torchdl\dl\log\trainer.py", line 335, in learn
return _learn_txtspotting(self, images, targets, texts)
File "C:\Users\kd207\Desktop\gleap\ocr\torchdl\dl\log\trainer.py", line 322, in _learn_txtspotting
loss, detn_loss, recog_loss = self.loss_module(detn, recog)
File "C:\Users\kd207\miniconda3\envs\pytorch\lib\site-packages\torch\nn\modules\module.py", line 532, in __call__
result = self.forward(*input, **kwargs)
File "C:\Users\kd207\Desktop\gleap\ocr\torchdl\dl\loss\fots.py", line 41, in forward
recog_loss = self.recog_loss(*recog)
File "C:\Users\kd207\miniconda3\envs\pytorch\lib\site-packages\torch\nn\modules\module.py", line 532, in __call__
result = self.forward(*input, **kwargs)
File "C:\Users\kd207\Desktop\gleap\ocr\torchdl\dl\loss\fots.py", line 231, in forward
loss = F.ctc_loss(predicts[0], targets[0], predict_lengths[0], target_lengths[0], blank=self.blankIndex, reduction='mean', zero_infinity=True)
File "C:\Users\kd207\miniconda3\envs\pytorch\lib\site-packages\torch\nn\functional.py", line 1780, in ctc_loss
return torch.ctc_loss(log_probs, targets, input_lengths, target_lengths, blank, _Reduction.get_enum(reduction),
RuntimeError: target_lengths must be of size batch_size
ctc_lossへの入力は以下の通りです。
p : torch.Size([21, 2, 69])
t : torch.Size([4, 5])
p_l : torch.Size([2])
t_l : torch.Size([4])
使用データセットは独自のもので、画像とアノテーションファイルは公開できません。
もし必要な場合は言ってください。
何かわかりましたら幸いです。
よろしくお願いします。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.