ooe1123
ooe1123
モデルにC++の実装が含まれるためエクスポートできない。(dcn、iou3d_nms) また、分岐処理なども多数含まれるもよう。
エラーとなるが、作成したエクスポートコードは以下。 〇 CenterPoint/det3d/torchie/apis/train.py ``` def batch_processor(model, data, train_mode, **kwargs): ... if train_mode: ... else: return model(example, return_loss=False) ``` ↓ ``` def batch_processor(model, data, train_mode, **kwargs): ... if train_mode: ... else:...
[onnxエクスポート] diffusersのスクリプトでエクスポート実行 ``` python scripts/convert_stable_diffusion_checkpoint_to_onnx.py --model_path="Bingxin/Marigold" --output_path="./sd_onnx" ```
推論 ``` ffmpeg -i noised.wav -ac 1 -ar 48000 -f s16le -acodec pcm_s16le noised.raw examples/rnnoise_demo noised.raw denoised.raw ffmpeg -ac 1 -ar 48000 -f s16le -acodec pcm_s16le -i denoised.raw denoised.wav ```
https://github.com/xiph/rnnoise/issues/79 こちらのスクリプトから、.pbファイルを作成することが可能。 tensorflow2では動作しないため、古いバージョンである必要がある。 ``` python rnn_train.py ``` Python 3.7.0 Keras==2.1.2 tensorflow==1.15.0
onnx変換 ``` python -m tf2onnx.convert --graphdef rnnoise.pb --output xxx.onnx --opset 14 --inputs main_input:0 --outputs denoise_output/Sigmoid:0,vad_output/Sigmoid:0 ``` TransposeOptimizerの処理が無限ループに陥るようなので、故意にエラーを発生させることで、エクスポートすることができた。 〇 tf2onnx/optimizer/transpose_optimizer.py ``` class TransposeOptimizer(GraphOptimizerBase): ... def _handle_nhwc_tranpose(self, trans): ... ``` ↓ ```...
重複 https://github.com/axinc-ai/ailia-models/issues/866
モデルの修正 ○ bark/model.py ``` class CausalSelfAttention(nn.Module): def __init__(self, config): ... self.flash = hasattr(torch.nn.functional, 'scaled_dot_product_attention') class Block(nn.Module): ... class GPT(nn.Module): ... ``` ↓ ``` class CausalSelfAttention(nn.Module): def __init__(self, config): ... self.flash...
[text.onnx] ○ bark/generation.py ``` def generate_text_semantic( ... ): ... with _inference_mode(): ... for n in range(n_tot_steps): if use_kv_caching and kv_cache is not None: x_input = x[:, [-1]] x_input = x...
[coarse.onnx] ○ bark/generation.py ``` def generate_coarse( ... ): ... with _inference_mode(): ... for _ in tqdm.tqdm(range(n_window_steps), total=n_window_steps, disable=silent): ... for _ in range(sliding_window_len): ... if use_kv_caching and kv_cache is not...