Conversation
6ee863c to
d8791f4
Compare
|
Can we stop using module attributes for settings? It annoying because there's no way to execute some code when the backend is changed (e.g. some kind of init). I'd be for adding |
|
I replaced the attribute with a setter |
9e67dd4 to
bd4c988
Compare
|
After fixing an issue with resize in accimage, the ResNet evaluation gives very similar results with PIL and with accimage. (All models were trained with PIL) ResNet-50 ResNet-18: |
| vis.image((expected_output - output).numpy()) | ||
|
|
||
| self.assertEqual(expected_output.size(), output.size()) | ||
| assert np.allclose(output.numpy(), expected_output.numpy()) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
test/test_transforms.py
Outdated
| expected_output = trans(Image.open(GRACE_HOPPER).convert('RGB')) | ||
| output = trans(accimage.Image(GRACE_HOPPER)) | ||
|
|
||
| import visdom |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| batch_count = 100 * args.nThreads | ||
| for i in tqdm(xrange(batch_count)): | ||
| batch_count = 20 * args.nThreads | ||
| for _ in tqdm(range(batch_count)): |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| self.assertEqual(expected_output.size(), output.size()) | ||
| self.assertLess(np.abs((expected_output - output).mean()), 1e-3) | ||
| self.assertLess((expected_output - output).var(), 1e-5) | ||
| # note the high absolute tolerance |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
It can be enabled by calling torchvision.set_image_backend('accimage')
* remove pycache * bring updated logging util to head
It can be enabled by setting torchvision.image_backend = 'accimage'
I've rebased and updated @Maratyszcza PR with tests
cc @Maratyszcza