ooe1123
ooe1123
こちらのモデルはすでに実装済ですね。 https://github.com/axinc-ai/ailia-models/pull/873
○ ldm/modules/attention.py 以下のエラー対策 ``` model has the following type (tensor(float16)) Found kernel for Op with name (LayerNormalization) and type (LayerNormalization) in the supported version range (node_version: 1 kernel start version:...
adaptive_avg_pool2dを使っているため、入力テンソルのサイズを固定して、サイズを32×3×5の倍数にする必要がある。
jax+flaxでの実装となっている。 現時点で、onnxへのエクスポートは不可能。
Pytorchではなく、luaのフレームワークのtorchによる実装になっている。 onnxへのエクスポートは困難そう。
○ models/resnet_dilate.py AdaptiveMaxPool2dにてエクスポートエラーが発生するため、エラーとならないshapeにリサイズしてからAdaptiveMaxPool2dを行う。 また、roisの計算を外出しにする。 ``` class RPN(nn.Module): ... def forward(self, x, depth): ... if self.adaptive_diated: weight = self.adaptive_layers(x).reshape(-1, 512, 1, 3) weight = self.adaptive_softmax(weight) ... if self.adaptive_diated: weight = self.adaptive_layers1(x).reshape(-1,...
lib/core/api/face_detector.py のFaceDetectorクラスのdef `__call__()` 内に以下のエクスポートコードを追記して、エクスポートすることができた。 ``` boxes,labels, scores, num_boxes = self._sess.run( self.output_ops, feed_dict={self.input_image: image_fornet,self.training:False} ) print("----->") import tf2onnx frozen_graph_def = tf.graph_util.convert_variables_to_constants( self._sess, self._sess.graph.as_graph_def(), ["tower_0/images", "training_flag", "tower_0/boxes", "tower_0/labels", "tower_0/scores", "tower_0/num_detections"]) graph1 =...
以下でエクスポートしたonnxが、ailia v1.2.9でロード可能 python -m tf2onnx.convert --graphdef model/detector.pb --output xxx.onnx --fold_const --opset 11 --inputs tower_0/images:0 --outputs tower_0/boxes:0,tower_0/labels:0,tower_0/scores:0,tower_0/num_detections:0
学習済みモデルが公開されているが、まともに動作しない https://drive.google.com/drive/folders/1VAihgSB5vGXwIVTl3hkUk95joxY1YbfW examples/conformer/test.py ではモデルのロードでshapeがミスマッチになる。 ``` python examples/conformer/test.py --config ./Conformer/LibriSpeech/subword-conformer/config.yml --saved ./Conformer/LibriSpeech/subword-conformer/latest.h5 ValueError: Shape mismatch in layer #1 (named conformer_prediction) for weight conformer/conformer_prediction/conformer_prediction_embedding/embeddings:0. Weight expects shape (29, 320). Received saved weight...
examples/demonstration/conformer.py による別のモデル subsampling-conformer を指定した場合、コードエラーになる。 ``` python examples/demonstration/conformer.py --config ./Conformer/LibriSpeech/subsampling-conformer/config.yml --saved ./Conformer/LibriSpeech/subsampling-conformer/latest.h5 examples/demonstration/wavs/1089-134691-0000.flac TypeError: __init__() missing 1 required positional argument: 'encoder_subsampling' ```