-
Notifications
You must be signed in to change notification settings - Fork 86
Add device inference test to e2e tests #872
Add device inference test to e2e tests #872
Conversation
40354f4
to
e8f2179
Compare
a21b695
to
3969633
Compare
This PR needs Approvals as follows.
Please choose reviewers and requet reviews! Click to see how to approve each reviewsYou can approve this PR by triggered comments as follows.
See all trigger commentsPlease replace [Target] to review target
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Readability Approval (reverse-shadowing)
7e6447a
to
bcaddf3
Compare
bcaddf3
to
152d411
Compare
1cc3237
to
a7d8632
Compare
@tfujiwar |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution!
I left some comments.
if output_dir: | ||
output_dir = output_dir[0] | ||
else: | ||
raise Exception("No such directory") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please think about more specific exceptions. In this case, FileNotFoundError
would be appropriate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tfujiwar
Thanks!
I tried to use it at first but there is not FileNotFoundError of python2. So I use a custom exception. But it is better to use IOError for python2, so I changed it with if
statement.
Please check it again!
sys.path.append(python_path) | ||
from run import run_prediction | ||
run_prediction(image, model, config) | ||
assert os.path.exists(os.path.join('output', "output.json")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use self.assertTrue
in unittest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
return [[case, self._get_param(case, input_path, lib_name)] for case in os.listdir(input_path)] | ||
|
||
def _run(self, python_path, image, model, config): | ||
sys.path.append(python_path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we need to initialize sys.path
for every test case to avoid the conflict of the module name run
among all test cases.
class DeviceE2eTest(unittest.TestCase):
sys_path_default = copy.deepcopy(sys.path)
def _run():
sys.path = copy.deepcopy(sys_path_default) + [python_path]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tfujiwar
Nice review! Thanks a lot! It would cause a bug, I didn' t noticed.
I fixed it 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OA
/ready |
⏳Merge job is queued... |
😥This PR is not approved yet. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Readability Approval
Thank you!!
/ready |
⏳Merge job is queued... |
What this patch does to fix the issue.
A part of #854
Added test on
ubuntu(x86)
,ubuntu(x86_avx)
,raspbery-pi(aarch64)
,de10-nano(arm)
I also tried to add
de10-nano(fpga)
, but the inference was hanged up. I think it is caused by our test configs so I decided to fix and add test for inference on fpga after this PR.Link to any relevant issues or pull requests.
After #870 and #871