Skip to content

Commit

Permalink
Fix problems introduced by LFB unit test (open-mmlab#677)
Browse files Browse the repository at this point in the history
* remove lmdb

* use temporary directory
  • Loading branch information
congee524 authored Mar 5, 2021
1 parent 7d52ab7 commit 0326abf
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ work_dirs/
# Profile
*.prof

# lmdb
*.mdb

# unignore some data file in tests/data
!tests/data/**/*.pkl
!tests/data/**/*.pkl.json
Expand Down
Binary file removed tests/data/lfb/lmdb/data.mdb
Binary file not shown.
Binary file removed tests/data/lfb/lmdb/lock.mdb
Binary file not shown.
6 changes: 4 additions & 2 deletions tests/test_models/test_head.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os.path as osp
import tempfile
from unittest.mock import Mock, patch

import numpy as np
Expand Down Expand Up @@ -312,8 +313,9 @@ def test_tsm_head():
def test_lfb_infer_head():
"""Test layer construction, attributes and forward function in lfb infer
head."""
lfb_infer_head = LFBInferHead(
lfb_prefix_path='temp_dir', use_half_precision=True)
with tempfile.TemporaryDirectory() as tmpdir:
lfb_infer_head = LFBInferHead(
lfb_prefix_path=tmpdir, use_half_precision=True)
lfb_infer_head.init_weights()

st_feat_shape = (3, 16, 1, 8, 8)
Expand Down

0 comments on commit 0326abf

Please sign in to comment.