Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Fix data loader issues and nox file paths #1281

Merged
merged 2 commits into from
Sep 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/int8/training/vgg16/export_qat.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def test(model, dataloader, crit):
quant_nn.TensorQuantizer.use_fb_fake_quant = True
with torch.no_grad():
data = iter(testing_dataloader)
images, _ = data.next()
images, _ = next(data)
jit_model = torch.jit.trace(model, images.to("cuda"))
torch.jit.save(jit_model, "trained_vgg16_qat.jit.pt")

Expand Down
6 changes: 3 additions & 3 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,8 @@ def run_trt_compatibility_tests(session):
copy_model(session)
session.chdir(os.path.join(TOP_DIR, "tests/py"))
tests = [
"test_trt_intercompatibility.py",
"test_ptq_trt_calibrator.py",
"integrations/test_trt_intercompatibility.py",
# "ptq/test_ptq_trt_calibrator.py",
]
for test in tests:
if USE_HOST_DEPS:
Expand All @@ -295,7 +295,7 @@ def run_multi_gpu_tests(session):
print("Running multi GPU tests")
session.chdir(os.path.join(TOP_DIR, "tests/py"))
tests = [
"test_multi_gpu.py",
"hw/test_multi_gpu.py",
]
for test in tests:
if USE_HOST_DEPS:
Expand Down
2 changes: 1 addition & 1 deletion py/torch_tensorrt/ptq.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def get_batch(self, names):
if self.current_batch_idx + self.batch_size > len(self.data_loader.dataset):
return None

batch = self.dataset_iterator.next()
batch = next(self.dataset_iterator)
self.current_batch_idx += self.batch_size
inputs_gpu = []
if isinstance(batch, list):
Expand Down
4 changes: 2 additions & 2 deletions tests/core/conversion/converters/test_select.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,7 @@ TEST(Converters, ScatterValueConvertsCorrectly) {
%5 : NoneType = prim::Constant()
%6 : bool = prim::Constant[value=0]()
%7 : int = prim::Constant[value=4]()
%index : Tensor = aten::to(%index.1, %7, %6, %6, %5)
%index : Tensor = aten::to(%index.1, %7, %6, %6, %5)
%10 : Tensor = aten::scatter(%data, %dim, %index, %value)
return (%10))IR";

Expand Down Expand Up @@ -900,7 +900,7 @@ TEST(Converters, ScatterSrcConvertsCorrectly) {
%5 : NoneType = prim::Constant()
%6 : bool = prim::Constant[value=0]()
%7 : int = prim::Constant[value=4]()
%index : Tensor = aten::to(%index.1, %7, %6, %6, %5)
%index : Tensor = aten::to(%index.1, %7, %6, %6, %5)
%10 : Tensor = aten::scatter(%data, %dim, %index, %src)
return (%10))IR";

Expand Down
2 changes: 1 addition & 1 deletion tests/py/ptq/test_ptq_trt_calibrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def get_batch(self, names):
):
return None

batch = self.dataset_iterator.next()
batch = next(self.dataset_iterator)
self.current_batch_idx += self.batch_size
# Treat the first element as input and others as targets.
if isinstance(batch, list):
Expand Down