-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Dataset MovingMNIST: split=None
returns test dataset
#7439
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
Comments
Thanks for the detailed report @Shu-Wan! This indeed seems wrong. IIUC, it should be enough to replace the diff --git a/torchvision/datasets/moving_mnist.py b/torchvision/datasets/moving_mnist.py
index afff0bfa3b..ac5a2b1503 100644
--- a/torchvision/datasets/moving_mnist.py
+++ b/torchvision/datasets/moving_mnist.py
@@ -58,7 +58,7 @@ class MovingMNIST(VisionDataset):
data = torch.from_numpy(np.load(os.path.join(self._base_folder, self._filename)))
if self.split == "train":
data = data[: self.split_ratio]
- else:
+ elif self.split == "test":
data = data[self.split_ratio :]
self.data = data.transpose(0, 1).unsqueeze(2).contiguous() Wondering why our tests missed this.
Go for it! |
Welp, that was not smart: Lines 1520 to 1529 in f0a1df3
We should assert there that the second dimension has 20 elements for |
Let's also change Line 1510 in f0a1df3
to a different number like 5 or whatever to avoid confusing the number of samples with the number of frames. |
@Shu-Wan we are preparing for the |
Hi Philip,
I will take care of this today. It should be an easy fix.
On Mar 22, 2023, at 4:44 AM, Philip Meier ***@***.***> wrote:
@Shu-Wan<https://github.com/Shu-Wan> we are preparing for the 0.15.2 bug fix release. Since MovingMNIST was released with 0.15, it would be good to get this fix in. Do you happen to have time to send patch soon? If not, are you ok with me taking over so we can get it released?
—
Reply to this email directly, view it on GitHub<#7439 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ADZWW7PU6LFZRMQWOKOZ6YTW5LQZJANCNFSM6AAAAAAWDFFL5U>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Uh oh!
There was an error while loading. Please reload this page.
🐛 Describe the bug
I've found a bug in the code for torchvision's MovingMNIST dataset, which causes only the test dataset to be returned when split=None. According to the documentation, when split is set to None, the entire dataset should be returned. However, this is not currently happening.
vision/torchvision/datasets/moving_mnist.py
Lines 13 to 19 in b403bfc
I've tested this with the following code:
I believe the bug is caused by lines 58-62 in the code, which handle None and test splits together:
vision/torchvision/datasets/moving_mnist.py
Lines 42 to 62 in b403bfc
To fix this, I propose the following two changes:
Reference issue: #6981
I'm happy to help on this issue, please assign to me on this one.
Versions
PyTorch version: 2.0.0
Is debug build: False
CUDA used to build PyTorch: None
ROCM used to build PyTorch: N/A
OS: macOS 13.2.1 (arm64)
GCC version: Could not collect
Clang version: 14.0.0 (clang-1400.0.29.202)
CMake version: Could not collect
Libc version: N/A
Python version: 3.10.9 | packaged by conda-forge | (main, Feb 2 2023, 20:26:08) [Clang 14.0.6 ] (64-bit runtime)
Python platform: macOS-13.2.1-arm64-arm-64bit
Is CUDA available: False
CUDA runtime version: No CUDA
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True
CPU:
Apple M1 Pro
Versions of relevant libraries:
[pip3] mypy-extensions==1.0.0
[pip3] numpy==1.24.2
[pip3] torch==2.0.0
[pip3] torch-tb-profiler==0.4.1
[pip3] torchvision==0.15.1
[conda] numpy 1.24.2 py310h3d2048e_0 conda-forge
[conda] pytorch 2.0.0 py3.10_0 pytorch
[conda] torch 2.0.0 pypi_0 pypi
[conda] torch-tb-profiler 0.4.1 pypi_0 pypi
[conda] torchvision 0.15.1 pypi_0 pypi
cc @pmeier
The text was updated successfully, but these errors were encountered: