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

Fix PT 1.8 compatibility issue #580

Merged
merged 10 commits into from
Mar 9, 2021
Merged
Show file tree
Hide file tree
Changes from 3 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
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
__pycache__/
*.py[cod]
*$py.class
data/

# C extensions
*.so
Expand Down Expand Up @@ -163,3 +164,8 @@ tests/test-reports/

# MLflow
mlruns/


# Downloaded Data through Scripts
VOCdevkit/
*.tar
3 changes: 2 additions & 1 deletion pl_bolts/datamodules/async_dataloader.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import collections.abc as container_abcs
import re
from queue import Queue
from threading import Thread
from typing import Any, Optional, Union

import torch
from torch._six import container_abcs, string_classes
from torch._six import string_classes
from torch.utils.data import DataLoader, Dataset


Expand Down
4 changes: 3 additions & 1 deletion pl_bolts/datasets/imagenet_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
import hashlib
import os
import shutil
import sys
import tarfile
import tempfile
import zipfile
from contextlib import contextmanager

import numpy as np
import torch
from torch._six import PY3

from pl_bolts.utils import _TORCHVISION_AVAILABLE
from pl_bolts.utils.warnings import warn_missing_pkg
Expand Down Expand Up @@ -246,6 +246,8 @@ def extract_archive(from_path, to_path=None, remove_finished=False):
if to_path is None:
to_path = os.path.dirname(from_path)

PY3 = sys.version_info[0] == 3

if _is_tar(from_path):
with tarfile.open(from_path, 'r') as tar:
tar.extractall(path=to_path)
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
torch>=1.6
kaushikb11 marked this conversation as resolved.
Show resolved Hide resolved
torch==1.8
pytorch-lightning>=1.1.1, <1.2
2 changes: 1 addition & 1 deletion requirements/models.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
torchvision>=0.7
torchvision==0.9.0
scikit-learn>=0.23
Pillow
opencv-python
Expand Down