From 8da6ee26efcdb69d330a860f546eac2dc2169faf Mon Sep 17 00:00:00 2001 From: maksad Date: Wed, 29 Apr 2020 10:46:05 +0300 Subject: [PATCH] Make packages versions consistent --- README.md | 11 ++++++++--- lib/utils/data/dataloader.py | 4 ++-- requirements.txt | 8 ++++++++ 3 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 requirements.txt diff --git a/README.md b/README.md index 116bef6..0ef49f6 100644 --- a/README.md +++ b/README.md @@ -47,14 +47,19 @@ You can use our pretrained models in PyTorch to segment input image. The usage i ```bash cd lib/nn/prroi_pool ./travis.sh -``` +``` You may need ```nvcc``` for this step. If it cannot find the path to ```cuda.h```, do ```bash export CPATH=/PATH/TO/YOUR/CUDA/include && ./travis.sh ``` -2. Now you're good to go! Here is a simple demo to do inference on a single image: +2. Install required packages +```bash +pip install -r requirements.txt +``` + +3. Now you're good to go! Here is a simple demo to do inference on a single image: ```bash chmod +x demo_test.sh @@ -63,7 +68,7 @@ chmod +x demo_test.sh This script downloads trained models and a test image, runs the test script, and saves predicted segmentation (.png) to the working directory. -3. Input arguments: (see full input arguments via python3 test.py -h) +4. Input arguments: (see full input arguments via python3 test.py -h) ```bash usage: test.py [-h] --test_img TEST_IMG --model_path MODEL_PATH [--suffix SUFFIX] [--arch_encoder ARCH_ENCODER] diff --git a/lib/utils/data/dataloader.py b/lib/utils/data/dataloader.py index 220f98d..f9942f9 100644 --- a/lib/utils/data/dataloader.py +++ b/lib/utils/data/dataloader.py @@ -1,6 +1,6 @@ import torch import torch.multiprocessing as multiprocessing -from torch._C import _set_worker_signal_handlers, _update_worker_pids, \ +from torch._C import _set_worker_signal_handlers, _set_worker_pids, \ _remove_worker_pids, _error_if_any_worker_fails from .sampler import SequentialSampler, RandomSampler, BatchSampler import signal @@ -235,7 +235,7 @@ def __init__(self, loader): w.daemon = True # ensure that the worker exits on process exit w.start() - _update_worker_pids(id(self), tuple(w.pid for w in self.workers)) + _set_worker_pids(id(self), tuple(w.pid for w in self.workers)) _set_SIGCHLD_handler() self.worker_pids_set = True diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..a69b07c --- /dev/null +++ b/requirements.txt @@ -0,0 +1,8 @@ +numpy==1.16.6 +pillow==6.2.2 +opencv-python==4.2.0.32 +scipy==1.1.0 +torch==1.4.0 +torchvision==0.5.0 +tqdm==4.45.0 +colormath==3.0.0