diff --git a/ppcls/engine/trainer.py b/ppcls/engine/trainer.py index 4bf62ba93e709a65e64cce1d95dc25348d91ebc0..b5771c774f5edc121a62c4d5342a74071ecef64b 100644 --- a/ppcls/engine/trainer.py +++ b/ppcls/engine/trainer.py @@ -335,12 +335,9 @@ class Trainer(object): name='gallery') query_feas, query_img_id, query_camera_id = self._cal_feature( name='query') - gallery_img_id = paddle.to_tensor([gallery_img_id]).t() + gallery_img_id = gallery_img_id.t() if gallery_camera_id is not None: - gallery_camera_id = paddle.to_tensor([gallery_camera_id]).t() - query_img_id = paddle.to_tensor(query_img_id) - if query_camera_id is not None: - query_camera_id = paddle.to_tensor(query_camera_id) + gallery_camera_id = gallery_camera_id.t() # step2. do evaluation sim_block_size = self.config["Global"].get("sim_block_size", 1) sections = [sim_block_size] * (len(query_feas) // sim_block_size)