Skip to content

Commit

Permalink
fix the gradient backward issue when joint training with s3prl frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
simpleoier committed May 10, 2023
1 parent 33aa097 commit 3434492
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
10 changes: 3 additions & 7 deletions espnet2/asr/frontend/s3prl.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,10 @@ def __init__(
normalize=frontend_conf.get("normalize", False),
extra_conf=frontend_conf.get("extra_conf", None),
)
if getattr(upstream.upstream, "model", None):
if getattr(upstream.upstream.model, "feature_grad_mult", None):
upstream.upstream.model.feature_grad_mult = 1.0
upstream.eval()
if getattr(
upstream.upstream, "model", None
) is not None and upstream.upstream.model.__class__.__name__ in [
"Wav2Vec2Model",
"HubertModel",
]:
upstream.upstream.model.encoder.layerdrop = 0.0

if layer != -1:
layer_selections = [layer]
Expand Down
1 change: 0 additions & 1 deletion tools/extra_path.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,4 @@ export PATH="${TOOL_DIR}"/festival/bin:"${PATH:-}"
export PATH="${TOOL_DIR}"/ffmpeg-release:"${PATH:-}"
export LD_LIBRARY_PATH="${TOOL_DIR}"/lib:"${TOOL_DIR}"/lib64:"${LD_LIBRARY_PATH:-}"
export LD_LIBRARY_PATH="${TOOL_DIR}"/espeak-ng/lib:"${LD_LIBRARY_PATH:-}"
export PYTHONPATH="${TOOL_DIR}"/s3prl:"${PYTHONPATH:-}"
export PYTHONPATH="${TOOL_DIR}"/RawNet/python/RawNet3:"${TOOL_DIR}"/RawNet/python/RawNet3/models:"${PYTHONPATH:-}"

0 comments on commit 3434492

Please sign in to comment.