diva-dia / deepdiva Goto Github PK
View Code? Open in Web Editor NEW⛔️ DEPRECATED <Python Framework for Reproducible Deep Learning Experiments>
Home Page: https://diva-dia.github.io/DeepDIVAweb
License: GNU Lesser General Public License v3.0
⛔️ DEPRECATED <Python Framework for Reproducible Deep Learning Experiments>
Home Page: https://diva-dia.github.io/DeepDIVAweb
License: GNU Lesser General Public License v3.0
Setting up deep-diva on a new machine (thus possibly related to using [email protected]) we ran into an issue downloading the mnist dataset.
$ python3 util/data/get_a_dataset.py --dataset mnist --output-folder dataset/mnist
Downloading http://yann.lecun.com/exdb/mnist/train-images-idx3-ubyte.gz to dataset/mnist/MNIST/raw/train-images-idx3-ubyte.gz
100.1%Extracting dataset/mnist/MNIST/raw/train-images-idx3-ubyte.gz
Downloading http://yann.lecun.com/exdb/mnist/train-labels-idx1-ubyte.gz to dataset/mnist/MNIST/raw/train-labels-idx1-ubyte.gz
113.5%Extracting dataset/mnist/MNIST/raw/train-labels-idx1-ubyte.gz
Downloading http://yann.lecun.com/exdb/mnist/t10k-images-idx3-ubyte.gz to dataset/mnist/MNIST/raw/t10k-images-idx3-ubyte.gz
100.4%Extracting dataset/mnist/MNIST/raw/t10k-images-idx3-ubyte.gz
Downloading http://yann.lecun.com/exdb/mnist/t10k-labels-idx1-ubyte.gz to dataset/mnist/MNIST/raw/t10k-labels-idx1-ubyte.gz
180.4%Extracting dataset/mnist/MNIST/raw/t10k-labels-idx1-ubyte.gz
Processing...
Done!
Traceback (most recent call last):
File "util/data/get_a_dataset.py", line 297, in <module>
getattr(sys.modules[__name__], args.dataset)(args)
File "util/data/get_a_dataset.py", line 46, in mnist
'training.pt'))
File "/home/ashlaban/.local/lib/python3.6/site-packages/torch/serialization.py", line 382, in load
f = open(f, 'rb')
FileNotFoundError: [Errno 2] No such file or directory: 'dataset/mnist/processed/training.pt'
from: https://diva-dia.github.io/DeepDIVAweb/articles/use-image-segmentation/
I run code by using resnet18 model.
python RunMe.py --dataset-folder /path/to/dataset --runner-class semantic_segmentation --no-cuda --ignoregit --model-name resnet18
.
For dataset, I use Diva-HisDB CB55 images
data images from
https://diuf.unifr.ch/main/hisdoc/sites/diuf.unifr.ch.main.hisdoc/files/uploads/diva-hisdb/hisdoc/img-CB55.zip
gt images from
https://diuf.unifr.ch/main/hisdoc/sites/diuf.unifr.ch.main.hisdoc/files/uploads/diva-hisdb/hisdoc/pixel-level-gt-CB55.zip
I arranged data to
dataset/train/data/
dataset/train/gt/
Trainning error is
[2019-10-04 10:04:58] [ ERROR] --- Unhandled error: RuntimeError('Given input size: (512x4x4). Calculated output size: (512x-2x-2). Output size is too small at /opt/conda/conda-bld/pytorch_1549636813070/work/aten/src/THNN/generic/SpatialAveragePooling.c:48') (RunMe.py:264)
[2019-10-04 10:04:58] [ ERROR] --- Traceback (most recent call last):
File "template/RunMe.py", line 257, in _execute
**args.__dict__)
File "/home/nott/AI/ancient/DeepDIVA/template/runner/image_classification/image_classification.py", line 47, in single_run
**kwargs)
File "/home/nott/AI/ancient/DeepDIVA/template/runner/image_classification/image_classification.py", line 144, in train_routine
val_value[-1] = cls._validate(epoch=-1, **kwargs)
File "/home/nott/AI/ancient/DeepDIVA/template/runner/semantic_segmentation/semantic_segmentation.py", line 40, in _validate
return evaluate.validate(class_encodings=cls.class_encoding, **kwargs)
File "/home/nott/AI/ancient/DeepDIVA/template/runner/semantic_segmentation/evaluate.py", line 78, in validate
output = model(input)
File "/home/nott/anaconda3/envs/deepdiva/lib/python3.7/site-packages/torch/nn/modules/module.py", line 489, in __call__
result = self.forward(*input, **kwargs)
File "/home/nott/AI/ancient/DeepDIVA/models/image_classification/ResNet.py", line 156, in forward
x = self.avgpool(x)
File "/home/nott/anaconda3/envs/deepdiva/lib/python3.7/site-packages/torch/nn/modules/module.py", line 489, in __call__
result = self.forward(*input, **kwargs)
File "/home/nott/anaconda3/envs/deepdiva/lib/python3.7/site-packages/torch/nn/modules/pooling.py", line 565, in forward
self.padding, self.ceil_mode, self.count_include_pad)
RuntimeError: Given input size: (512x4x4). Calculated output size: (512x-2x-2). Output size is too small at /opt/conda/conda-bld/pytorch_1549636813070/work/aten/src/THNN/generic/SpatialAveragePooling.c:48
(RunMe.py:265)
I use latest git deepdiva and release version but still have this error
Having trouble with creating a embedding to visualize. As per the DeepDIVA tutorial I use the following command,
python util/visualization/embedding.py --results-file /home/local/DFPOC/ghfiy/DeepDIVA/output/OSRAM3/MNIST/output_channels=10/no_cuda=True/04-06-19-10h-27m-58s/results.pkl --output-file /home/local/DFPOC/ghfiy/DeepDIVA/output/OSRAM3/MNIST/output_channels=10/no_cuda=True/04-06-19-10h-27m-58s --embedding tsne --tensorboard
whereby as per instructions I specify path to output folder. This is the error I get,
_usage: embedding.py [-h] [--results-file RESULTS_FILE]
[--embedding {_load_thumbnail,_main,_make_embedding,make_folder_if_not_exists,isomap,mds,pca,tsne}]
[--output OUTPUT] [--3d] [--tensorboard]
embedding.py: error: unrecognized arguments: --output-file /home/local/DFPOC/ghfiy/DeepDIVA/output/OSRAM3/MNIST/output_channels=10/no_cuda=True/04-06-19-10h-27m-58s
Since it complains of unrecognized argument I looked up the embedding.py script and saw the following lines,
parser.add_argument('--output', type=str, default='./output.png', help='path to generate output image')
Therefore I changed the command to,
python util/visualization/embedding.py --results-file /home/local/DFPOC/ghfiy/DeepDIVA/output/OSRAM3/MNIST/output_channels=10/no_cuda=True/04-06-19-10h-27m-58s/results.pkl --output /home/local/DFPOC/ghfiy/DeepDIVA/output/OSRAM3/MNIST/output_channels=10/no_cuda=True/04-06-19-10h-27m-58s --embedding tsne --tensorboard
Then the following error pops up,
_Traceback (most recent call last):
File "util/visualization/embedding.py", line 242, in
_main(args)
File "util/visualization/embedding.py", line 192, in _main
make_folder_if_not_exists(os.path.dirname(args.output_file))
AttributeError: 'Namespace' object has no attribute 'output_file'
Also tried the following,
(deepdiva) ghfiy@by-df547:~/DeepDIVA$ python util/visualization/embedding.py --results-file /home/local/DFPOC/ghfiy/DeepDIVA/output/OSRAM3/MNIST/output_channels=10/no_cuda=True/04-06-19-10h-27m-58s/results.pkl --output_file /home/local/DFPOC/ghfiy/DeepDIVA/output/OSRAM3/MNIST/output_channels=10/no_cuda=True/04-06-19-10h-27m-58s --embedding tsne --tensorboard
_usage: embedding.py [-h] [--results-file RESULTS_FILE]
[--embedding {_load_thumbnail,_main,_make_embedding,make_folder_if_not_exists,isomap,mds,pca,tsne}]
[--output OUTPUT] [--3d] [--tensorboard]
embedding.py: error: unrecognized arguments: --output_file /home/local/DFPOC/ghfiy/DeepDIVA/output/OSRAM3/MNIST/output_channels=10/no_cuda=True/04-06-19-10h-27m-58s
(deepdiva) ghfiy@by-df547:~/DeepDIVA$ python util/visualization/embedding.py --results-file /home/local/DFPOC/ghfiy/DeepDIVA/output/OSRAM3/MNIST/output_channels=10/no_cuda=True/04-06-19-10h-27m-58s/results.pkl --output-file ./output.png --embedding tsne --tensorboard
_usage: embedding.py [-h] [--results-file RESULTS_FILE]
[--embedding {_load_thumbnail,_main,_make_embedding,make_folder_if_not_exists,isomap,mds,pca,tsne}]
[--output OUTPUT] [--3d] [--tensorboard]
embedding.py: error: unrecognized arguments: --output-file ./output.png
and various other permutations and combinations. What would be the right way to specify this argument?
Gets errors when running 'bash setup_environment.sh' which presumably causes further errors when attempting to Download mnist ('python util/data/get_a_dataset.py --dataset mnist --output-folder toy_dataset') when following the 'Getting started' instructions.
Printout from command line for Getting started process:
Collecting package metadata (repodata.json): done
Solving environment: done
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
Ran pip subprocess with arguments:
['/opt/Anaconda/envs/deepdiva/bin/python', '-m', 'pip', 'install', '-U', '-r', '/nfs/staff/gusgru/Repositories/DeepDIVA/condaenv.hygei685.requirements.txt']
Pip subprocess output:
Requirement already up-to-date: dask==1.2.2 in /opt/Anaconda/envs/deepdiva/lib/python3.7/site-packages (from -r /nfs/staff/gusgru/Repositories/DeepDIVA/condaenv.hygei685.requirements.txt (line 1)) (1.2.2)
Collecting pydensecrf==1.0rc2 (from -r /nfs/staff/gusgru/Repositories/DeepDIVA/condaenv.hygei685.requirements.txt (line 2))
Using cached https://files.pythonhosted.org/packages/dd/11/7a79e817078323893f8071bb3fda1f45e34e443ec4a0790f8542158bbced/pydensecrf-1.0rc2.tar.gz
Collecting rarfile==3.0 (from -r /nfs/staff/gusgru/Repositories/DeepDIVA/condaenv.hygei685.requirements.txt (line 3))
Requirement already up-to-date: torch==1.0.1.post2 in /opt/Anaconda/envs/deepdiva/lib/python3.7/site-packages (from -r /nfs/staff/gusgru/Repositories/DeepDIVA/condaenv.hygei685.requirements.txt (line 4)) (1.0.1.post2)
Requirement already up-to-date: wget==3.2 in /opt/Anaconda/envs/deepdiva/lib/python3.7/site-packages (from -r /nfs/staff/gusgru/Repositories/DeepDIVA/condaenv.hygei685.requirements.txt (line 5)) (3.2)
Building wheels for collected packages: pydensecrf
Building wheel for pydensecrf (setup.py): started
Building wheel for pydensecrf (setup.py): finished with status 'error'
Complete output from command /opt/Anaconda/envs/deepdiva/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-xor3fcig/pydensecrf/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-w0gp68c6 --python-tag cp37:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.7
creating build/lib.linux-x86_64-3.7/pydensecrf
copying pydensecrf/test.py -> build/lib.linux-x86_64-3.7/pydensecrf
copying pydensecrf/utils.py -> build/lib.linux-x86_64-3.7/pydensecrf
copying pydensecrf/__init__.py -> build/lib.linux-x86_64-3.7/pydensecrf
copying pydensecrf/test_eigen.py -> build/lib.linux-x86_64-3.7/pydensecrf
running build_ext
building 'pydensecrf.eigen' extension
creating build/temp.linux-x86_64-3.7
creating build/temp.linux-x86_64-3.7/pydensecrf
gcc -pthread -B /opt/Anaconda/envs/deepdiva/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Ipydensecrf/densecrf/include -Ipydensecrf -I/opt/Anaconda/envs/deepdiva/include/python3.7m -c pydensecrf/eigen.cpp -o build/temp.linux-x86_64-3.7/pydensecrf/eigen.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
In file included from pydensecrf/densecrf/include/Eigen/Core:248:0,
from pydensecrf/densecrf/include/Eigen/Dense:1,
from pydensecrf/eigen.cpp:299:
pydensecrf/densecrf/include/Eigen/src/Core/util/Memory.h: In function ‘Index Eigen::internal::first_aligned(const Scalar*, Index)’:
pydensecrf/densecrf/include/Eigen/src/Core/util/Memory.h:454:48: warning: typedef ‘Packet’ locally defined but not used [-Wunused-local-typedefs]
typedef typename packet_traits<Scalar>::type Packet;
^
In file included from pydensecrf/densecrf/include/Eigen/Core:324:0,
from pydensecrf/densecrf/include/Eigen/Dense:1,
from pydensecrf/eigen.cpp:299:
pydensecrf/densecrf/include/Eigen/src/Core/products/SelfadjointMatrixVector.h: In static member function ‘static void Eigen::internal::selfadjoint_matrix_vector_product<Scalar, Index, StorageOrder, UpLo, ConjugateLhs, ConjugateRhs, Version>::run(Index, const Scalar*, Index, const Scalar*, Index, Scalar*, Scalar)’:
pydensecrf/densecrf/include/Eigen/src/Core/products/SelfadjointMatrixVector.h:38:44: warning: typedef ‘RealScalar’ locally defined but not used [-Wunused-local-typedefs]
typedef typename NumTraits<Scalar>::Real RealScalar;
^
In file included from pydensecrf/densecrf/include/Eigen/QR:26:0,
from pydensecrf/densecrf/include/Eigen/Dense:4,
from pydensecrf/eigen.cpp:299:
pydensecrf/densecrf/include/Eigen/src/QR/HouseholderQR.h: In function ‘void Eigen::internal::householder_qr_inplace_blocked(MatrixQR&, HCoeffs&, typename MatrixQR::Index, typename MatrixQR::Scalar*)’:
pydensecrf/densecrf/include/Eigen/src/QR/HouseholderQR.h:235:41: warning: typedef ‘RealScalar’ locally defined but not used [-Wunused-local-typedefs]
typedef typename MatrixQR::RealScalar RealScalar;
^
In file included from pydensecrf/densecrf/include/Eigen/Eigenvalues:28:0,
from pydensecrf/densecrf/include/Eigen/Dense:7,
from pydensecrf/eigen.cpp:299:
pydensecrf/densecrf/include/Eigen/src/Eigenvalues/Tridiagonalization.h: In function ‘void Eigen::internal::tridiagonalization_inplace(MatrixType&, DiagonalType&, SubDiagonalType&, bool)’:
pydensecrf/densecrf/include/Eigen/src/Eigenvalues/Tridiagonalization.h:428:38: warning: typedef ‘Index’ locally defined but not used [-Wunused-local-typedefs]
typedef typename MatrixType::Index Index;
^
In file included from pydensecrf/densecrf/include/Eigen/Eigenvalues:34:0,
from pydensecrf/densecrf/include/Eigen/Dense:7,
from pydensecrf/eigen.cpp:299:
pydensecrf/densecrf/include/Eigen/src/Eigenvalues/ComplexSchur.h: In static member function ‘static void Eigen::internal::complex_schur_reduce_to_hessenberg<MatrixType, false>::run(Eigen::ComplexSchur<MatrixType>&, const MatrixType&, bool)’:
pydensecrf/densecrf/include/Eigen/src/Eigenvalues/ComplexSchur.h:312:66: warning: typedef ‘ComplexMatrixType’ locally defined but not used [-Wunused-local-typedefs]
typedef typename ComplexSchur<MatrixType>::ComplexMatrixType ComplexMatrixType;
^
pydensecrf/eigen.cpp: In function ‘void __Pyx__ExceptionSave(PyThreadState*, PyObject**, PyObject**, PyObject**)’:
pydensecrf/eigen.cpp:17032:21: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_type’
*type = tstate->exc_type;
^
pydensecrf/eigen.cpp:17033:22: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_value’
*value = tstate->exc_value;
^
pydensecrf/eigen.cpp:17034:19: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_traceback’
*tb = tstate->exc_traceback;
^
pydensecrf/eigen.cpp: In function ‘void __Pyx__ExceptionReset(PyThreadState*, PyObject*, PyObject*, PyObject*)’:
pydensecrf/eigen.cpp:17041:24: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_type’
tmp_type = tstate->exc_type;
^
pydensecrf/eigen.cpp:17042:25: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_value’
tmp_value = tstate->exc_value;
^
pydensecrf/eigen.cpp:17043:22: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_traceback’
tmp_tb = tstate->exc_traceback;
^
pydensecrf/eigen.cpp:17044:13: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_type’
tstate->exc_type = type;
^
pydensecrf/eigen.cpp:17045:13: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_value’
tstate->exc_value = value;
^
pydensecrf/eigen.cpp:17046:13: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_traceback’
tstate->exc_traceback = tb;
^
pydensecrf/eigen.cpp: In function ‘int __Pyx__GetException(PyThreadState*, PyObject**, PyObject**, PyObject**)’:
pydensecrf/eigen.cpp:17101:24: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_type’
tmp_type = tstate->exc_type;
^
pydensecrf/eigen.cpp:17102:25: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_value’
tmp_value = tstate->exc_value;
^
pydensecrf/eigen.cpp:17103:22: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_traceback’
tmp_tb = tstate->exc_traceback;
^
pydensecrf/eigen.cpp:17104:13: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_type’
tstate->exc_type = local_type;
^
pydensecrf/eigen.cpp:17105:13: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_value’
tstate->exc_value = local_value;
^
pydensecrf/eigen.cpp:17106:13: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_traceback’
tstate->exc_traceback = local_tb;
^
pydensecrf/eigen.cpp: In function ‘void __Pyx__ExceptionSwap(PyThreadState*, PyObject**, PyObject**, PyObject**)’:
pydensecrf/eigen.cpp:17128:24: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_type’
tmp_type = tstate->exc_type;
^
pydensecrf/eigen.cpp:17129:25: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_value’
tmp_value = tstate->exc_value;
^
pydensecrf/eigen.cpp:17130:22: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_traceback’
tmp_tb = tstate->exc_traceback;
^
pydensecrf/eigen.cpp:17131:13: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_type’
tstate->exc_type = *type;
^
pydensecrf/eigen.cpp:17132:13: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_value’
tstate->exc_value = *value;
^
pydensecrf/eigen.cpp:17133:13: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_traceback’
tstate->exc_traceback = *tb;
^
In file included from pydensecrf/eigen.cpp:300:0:
pydensecrf/eigen_impl.cpp: At global scope:
pydensecrf/eigen_impl.cpp:13:13: warning: ‘void vecf2buf(const VectorXf&, float*)’ defined but not used [-Wunused-function]
static void vecf2buf(const Eigen::VectorXf& vec, float *mem)
^
pydensecrf/eigen_impl.cpp:27:13: warning: ‘void matf2buf(const MatrixXf&, float*)’ defined but not used [-Wunused-function]
static void matf2buf(const Eigen::MatrixXf& mat, float *mem)
^
error: command 'gcc' failed with exit status 1
----------------------------------------
Running setup.py clean for pydensecrf
Failed to build pydensecrf
Installing collected packages: pydensecrf, rarfile
Running setup.py install for pydensecrf: started
Running setup.py install for pydensecrf: finished with status 'error'
Complete output from command /opt/Anaconda/envs/deepdiva/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-xor3fcig/pydensecrf/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-6a_kt9ca/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.7
creating build/lib.linux-x86_64-3.7/pydensecrf
copying pydensecrf/test.py -> build/lib.linux-x86_64-3.7/pydensecrf
copying pydensecrf/utils.py -> build/lib.linux-x86_64-3.7/pydensecrf
copying pydensecrf/__init__.py -> build/lib.linux-x86_64-3.7/pydensecrf
copying pydensecrf/test_eigen.py -> build/lib.linux-x86_64-3.7/pydensecrf
running build_ext
building 'pydensecrf.eigen' extension
creating build/temp.linux-x86_64-3.7
creating build/temp.linux-x86_64-3.7/pydensecrf
gcc -pthread -B /opt/Anaconda/envs/deepdiva/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Ipydensecrf/densecrf/include -Ipydensecrf -I/opt/Anaconda/envs/deepdiva/include/python3.7m -c pydensecrf/eigen.cpp -o build/temp.linux-x86_64-3.7/pydensecrf/eigen.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
In file included from pydensecrf/densecrf/include/Eigen/Core:248:0,
from pydensecrf/densecrf/include/Eigen/Dense:1,
from pydensecrf/eigen.cpp:299:
pydensecrf/densecrf/include/Eigen/src/Core/util/Memory.h: In function ‘Index Eigen::internal::first_aligned(const Scalar*, Index)’:
pydensecrf/densecrf/include/Eigen/src/Core/util/Memory.h:454:48: warning: typedef ‘Packet’ locally defined but not used [-Wunused-local-typedefs]
typedef typename packet_traits<Scalar>::type Packet;
^
In file included from pydensecrf/densecrf/include/Eigen/Core:324:0,
from pydensecrf/densecrf/include/Eigen/Dense:1,
from pydensecrf/eigen.cpp:299:
pydensecrf/densecrf/include/Eigen/src/Core/products/SelfadjointMatrixVector.h: In static member function ‘static void Eigen::internal::selfadjoint_matrix_vector_product<Scalar, Index, StorageOrder, UpLo, ConjugateLhs, ConjugateRhs, Version>::run(Index, const Scalar*, Index, const Scalar*, Index, Scalar*, Scalar)’:
pydensecrf/densecrf/include/Eigen/src/Core/products/SelfadjointMatrixVector.h:38:44: warning: typedef ‘RealScalar’ locally defined but not used [-Wunused-local-typedefs]
typedef typename NumTraits<Scalar>::Real RealScalar;
^
In file included from pydensecrf/densecrf/include/Eigen/QR:26:0,
from pydensecrf/densecrf/include/Eigen/Dense:4,
from pydensecrf/eigen.cpp:299:
pydensecrf/densecrf/include/Eigen/src/QR/HouseholderQR.h: In function ‘void Eigen::internal::householder_qr_inplace_blocked(MatrixQR&, HCoeffs&, typename MatrixQR::Index, typename MatrixQR::Scalar*)’:
pydensecrf/densecrf/include/Eigen/src/QR/HouseholderQR.h:235:41: warning: typedef ‘RealScalar’ locally defined but not used [-Wunused-local-typedefs]
typedef typename MatrixQR::RealScalar RealScalar;
^
In file included from pydensecrf/densecrf/include/Eigen/Eigenvalues:28:0,
from pydensecrf/densecrf/include/Eigen/Dense:7,
from pydensecrf/eigen.cpp:299:
pydensecrf/densecrf/include/Eigen/src/Eigenvalues/Tridiagonalization.h: In function ‘void Eigen::internal::tridiagonalization_inplace(MatrixType&, DiagonalType&, SubDiagonalType&, bool)’:
pydensecrf/densecrf/include/Eigen/src/Eigenvalues/Tridiagonalization.h:428:38: warning: typedef ‘Index’ locally defined but not used [-Wunused-local-typedefs]
typedef typename MatrixType::Index Index;
^
In file included from pydensecrf/densecrf/include/Eigen/Eigenvalues:34:0,
from pydensecrf/densecrf/include/Eigen/Dense:7,
from pydensecrf/eigen.cpp:299:
pydensecrf/densecrf/include/Eigen/src/Eigenvalues/ComplexSchur.h: In static member function ‘static void Eigen::internal::complex_schur_reduce_to_hessenberg<MatrixType, false>::run(Eigen::ComplexSchur<MatrixType>&, const MatrixType&, bool)’:
pydensecrf/densecrf/include/Eigen/src/Eigenvalues/ComplexSchur.h:312:66: warning: typedef ‘ComplexMatrixType’ locally defined but not used [-Wunused-local-typedefs]
typedef typename ComplexSchur<MatrixType>::ComplexMatrixType ComplexMatrixType;
^
pydensecrf/eigen.cpp: In function ‘void __Pyx__ExceptionSave(PyThreadState*, PyObject**, PyObject**, PyObject**)’:
pydensecrf/eigen.cpp:17032:21: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_type’
*type = tstate->exc_type;
^
pydensecrf/eigen.cpp:17033:22: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_value’
*value = tstate->exc_value;
^
pydensecrf/eigen.cpp:17034:19: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_traceback’
*tb = tstate->exc_traceback;
^
pydensecrf/eigen.cpp: In function ‘void __Pyx__ExceptionReset(PyThreadState*, PyObject*, PyObject*, PyObject*)’:
pydensecrf/eigen.cpp:17041:24: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_type’
tmp_type = tstate->exc_type;
^
pydensecrf/eigen.cpp:17042:25: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_value’
tmp_value = tstate->exc_value;
^
pydensecrf/eigen.cpp:17043:22: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_traceback’
tmp_tb = tstate->exc_traceback;
^
pydensecrf/eigen.cpp:17044:13: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_type’
tstate->exc_type = type;
^
pydensecrf/eigen.cpp:17045:13: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_value’
tstate->exc_value = value;
^
pydensecrf/eigen.cpp:17046:13: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_traceback’
tstate->exc_traceback = tb;
^
pydensecrf/eigen.cpp: In function ‘int __Pyx__GetException(PyThreadState*, PyObject**, PyObject**, PyObject**)’:
pydensecrf/eigen.cpp:17101:24: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_type’
tmp_type = tstate->exc_type;
^
pydensecrf/eigen.cpp:17102:25: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_value’
tmp_value = tstate->exc_value;
^
pydensecrf/eigen.cpp:17103:22: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_traceback’
tmp_tb = tstate->exc_traceback;
^
pydensecrf/eigen.cpp:17104:13: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_type’
tstate->exc_type = local_type;
Setup completed!
Please run 'source ~/.bashrc' to refresh your environment
You can activate the deepdiva environment with 'source activate deepdiva'
(base) gusgru@B4375:~/Repositories/DeepDIVA$ source ~/.bashrc
(base) gusgru@B4375:~/Repositories/DeepDIVA$ source activate deepdiva
(deepdiva) gusgru@B4375:~/Repositories/DeepDIVA$ python util/data/get_a_dataset.py --dataset mnist --output-folder toy_dataset
Traceback (most recent call last):
File "util/data/get_a_dataset.py", line 19, in <module>
import rarfile
ModuleNotFoundError: No module named 'rarfile'
Just a few notes from my interaction with the sigopt integration.
I will update this issue if I come across more points.
AFAIU, triplet training uses the MAP metric which ranges from 0 (bad) to 1 (good). I.e. the best value is the one with the maximum value. Hence I suspect this line of code:
DeepDIVA/template/runner/triplet/triplet.py
Line 130 in 6806103
should read
invert_best=False,
instead of True.
Hi.
I removed the DeepDIVA and miniconda3 folder to make a clean reinstall of DeepDiva, but everytime I run setup_environment.sh it get to line 42: echo 'source ~/.bash_functions' >> ~/.bashrc
the terminal stops, prints 'segmentation fault' and crashes. If I then try to open a new terminal, it also crashes until I remove the source ~/.bash_functions
from my .bashrc.
Initially, the segmentation fault showed up when I deteled everything within the >>>> initialized by conda
block. I did this because I ran setup_environment.sh a second time (I did this really just to see what would happen). The result of running setup_enviroment.sh a second time was additional >>>> initialized by conda
blocks in my .bashrc.
I am assuming that there is some .bash_whatever or some path variable that messes things up but I do not know where to start searching.
When trying to extract features from a model I provide the path to the checkpoint as so,
python template/RunMe.py --runner-class apply_model --dataset-folder toy_dataset/MNIST --load-model /home/local/DFPOC/ghfiy/DeepDIVA/log/OSRAM/MNIST/epochs=1/lr=1e-06/no_cuda=True/03-06-19-13h-22m-02s/ckeckpoint.pth.tar --output-channels 10 --ignoregit --no-cuda
However when it attempts to search the location the following pops up,
[2019-06-03 20:13:10] [ INFO] --- Setup logging. Log file: ./output/OSRAM3/MNIST/output_channels=10/no_cuda=True/03-06-19-20h-13m-10s/logs.txt (setup.py:566)
[2019-06-03 20:13:10] [ INFO] --- Arguments saved to: ./output/OSRAM3/MNIST/output_channels=10/no_cuda=True/03-06-19-20h-13m-10s/args.txt (setup.py:569)
[2019-06-03 20:13:10] [ INFO] --- Initialize Tensorboard SummaryWriter (setup.py:574)
[2019-06-03 20:13:13] [ WARNING] --- Git status is ignored! (RunMe.py:205)
[2019-06-03 20:13:13] [ INFO] --- Randomly chosen seed is: 1936313780 (setup.py:651)
[2019-06-03 20:13:13] [ INFO] --- Model CNN_basic expects input size of (32, 32) (apply_model.py:70)
[2019-06-03 20:13:13] [ INFO] --- Loading MNIST from:toy_dataset/MNIST (setup.py:61)
[2019-06-03 20:13:14] [ INFO] --- Setting up model CNN_basic (setup.py:90)
[2019-06-03 20:13:14] [ INFO] --- Loading weights for data balancing (setup.py:229)
[2019-06-03 20:13:14] [ ERROR] --- No model dict found at '/home/local/DFPOC/ghfiy/DeepDIVA/log/OSRAM/MNIST/epochs=1/lr=1e-06/no_cuda=True/03-06-19-13h-22m-02s/ckeckpoint.pth.tar' (setup.py:118)
I have checked and the file checkpoint.pth.tar does exist in this location. Hopefully this is right file containing the checkpoint. What could be a possible workaround for this issue?
Setting up diva on a new machine (without conda, but the problem should apply in the conda case as well since the torch version is not pinned and the latest conda version is [email protected]) we ran into some issues:
util/data/get_a_dataset.py
the dataset properties changed from train_data, train_labels = cifar_train.train_data, cifar_train.train_labels
test_data, test_labels = cifar_test.test_data, cifar_test.test_labels
to
train_data, train_labels = cifar_train.data, cifar_train.targets
test_data, test_labels = cifar_test.data, cifar_test.targets
. This should apply to all datasets loaded through the same mechanism.
It seems torch no longer supports accessing 0-dim elements through array indexing. As such this change was required: loss.data[0]
-> loss.data.item()
in template/runner/image_classification/evaluate.py
and template/runner/image_classification/train.py
. Should be applicable also to apply_model etc.
Something is fishy with the arrays returned from _load_mean_std_from_file
, the transforms.Normalize
cannot convert the input mean and std to float tensors, instead the input is considered of dtype=np.object
. Check setup_dataloader
in template/setup.py
.
If I find the time I will also provide a proper PR for these problems. For now, please see attached patch.
diff --git a/template/runner/image_classification/evaluate.py b/template/runner/image_classification/evaluate.py
index 9205d73..e22f594 100644
--- a/template/runner/image_classification/evaluate.py
+++ b/template/runner/image_classification/evaluate.py
@@ -91,7 +91,7 @@ def _evaluate(data_loader, model, criterion, writer, epoch, logging_label, no_cu
# Compute and record the loss
loss = criterion(output, target_var)
- losses.update(loss.data[0], input.size(0))
+ losses.update(loss.data.item(), input.size(0))
# Compute and record the accuracy
acc1 = accuracy(output.data, target, topk=(1,))[0]
@@ -103,10 +103,10 @@ def _evaluate(data_loader, model, criterion, writer, epoch, logging_label, no_cu
# Add loss and accuracy to Tensorboard
if multi_run is None:
- writer.add_scalar(logging_label + '/mb_loss', loss.data[0], epoch * len(data_loader) + batch_idx)
+ writer.add_scalar(logging_label + '/mb_loss', loss.data.item(), epoch * len(data_loader) + batch_idx)
writer.add_scalar(logging_label + '/mb_accuracy', acc1.cpu().numpy(), epoch * len(data_loader) + batch_idx)
else:
- writer.add_scalar(logging_label + '/mb_loss_{}'.format(multi_run), loss.data[0],
+ writer.add_scalar(logging_label + '/mb_loss_{}'.format(multi_run), loss.data.item(),
epoch * len(data_loader) + batch_idx)
writer.add_scalar(logging_label + '/mb_accuracy_{}'.format(multi_run), acc1.cpu().numpy(),
epoch * len(data_loader) + batch_idx)
diff --git a/template/runner/image_classification/train.py b/template/runner/image_classification/train.py
index 9cf2324..497eee5 100644
--- a/template/runner/image_classification/train.py
+++ b/template/runner/image_classification/train.py
@@ -72,10 +72,10 @@ def train(train_loader, model, criterion, optimizer, writer, epoch, no_cuda=Fals
# Add loss and accuracy to Tensorboard
if multi_run is None:
- writer.add_scalar('train/mb_loss', loss.data[0], epoch * len(train_loader) + batch_idx)
+ writer.add_scalar('train/mb_loss', loss.data.item(), epoch * len(train_loader) + batch_idx)
writer.add_scalar('train/mb_accuracy', acc.cpu().numpy(), epoch * len(train_loader) + batch_idx)
else:
- writer.add_scalar('train/mb_loss_{}'.format(multi_run), loss.data[0],
+ writer.add_scalar('train/mb_loss_{}'.format(multi_run), loss.data.item(),
epoch * len(train_loader) + batch_idx)
writer.add_scalar('train/mb_accuracy_{}'.format(multi_run), acc.cpu().numpy(),
epoch * len(train_loader) + batch_idx)
@@ -141,7 +141,7 @@ def train_one_mini_batch(model, criterion, optimizer, input_var, target_var, los
# Compute and record the loss
loss = criterion(output, target_var)
- loss_meter.update(loss.data[0], len(input_var))
+ loss_meter.update(loss.data.item(), len(input_var))
# Compute and record the accuracy
acc = accuracy(output.data, target_var.data, topk=(1,))[0]
diff --git a/template/setup.py b/template/setup.py
index 2a87ccd..77c68a4 100644
--- a/template/setup.py
+++ b/template/setup.py
@@ -275,6 +275,8 @@ def set_up_dataloaders(model_expected_input_size, dataset_folder, batch_size, wo
# Loads the analytics csv and extract mean and std
mean, std = _load_mean_std_from_file(dataset_folder, inmem, workers)
+ mean = np.asarray([x for x in mean], dtype=np.float32)
+ std = np.asarray([x for x in std], dtype=np.float32)
# Set up dataset transforms
logging.debug('Setting up dataset transforms')
diff --git a/util/data/get_a_dataset.py b/util/data/get_a_dataset.py
index 5b78ef8..ea36794 100644
--- a/util/data/get_a_dataset.py
+++ b/util/data/get_a_dataset.py
@@ -150,9 +151,9 @@ def cifar10(args):
cifar_test = torchvision.datasets.CIFAR10(root=args.output_folder, train=False, download=True)
# Load the data into memory
- train_data, train_labels = cifar_train.train_data, cifar_train.train_labels
+ train_data, train_labels = cifar_train.data, cifar_train.targets
- test_data, test_labels = cifar_test.test_data, cifar_test.test_labels
+ test_data, test_labels = cifar_test.data, cifar_test.targets
# Make output folders
dataset_root = os.path.join(args.output_folder, 'CIFAR10')
Renaming this member from train
to use_triplet_output
more clearly indicates that this is a switchable property (if one e.g. would want to eval both the triplet loss and the mAP "accuracy" metric on the same dataset).
DeepDIVA/datasets/image_folder_triplet.py
Line 103 in 4dccf3b
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.