meder411 / pytorch-emdloss Goto Github PK
View Code? Open in Web Editor NEWPyTorch 1.0 implementation of the approximate Earth Mover's Distance
PyTorch 1.0 implementation of the approximate Earth Mover's Distance
Could you help me with this error plz ?
CUDA kernel failed: no error (pkg/include/cuda/emd.cuh:247)
If you thinks my work is ok . Give me a star, thank you. I have stared for your work.
I'm using PyTorch 1.7 + cuda 11. When I run python setup.py install, this is the long ninja error.
I don't know what caused this. Is it because my cuda and pytorch are too new? How can I solve this?
running install
running bdist_egg
running egg_info
writing PyTorch_EMD.egg-info/PKG-INFO
writing dependency_links to PyTorch_EMD.egg-info/dependency_links.txt
writing top-level names to PyTorch_EMD.egg-info/top_level.txt
reading manifest file 'PyTorch_EMD.egg-info/SOURCES.txt'
writing manifest file 'PyTorch_EMD.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
running build_ext
building 'emd' extension
Emitting ninja build file /home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/build/temp.linux-x86_64-3.6/build.ninja...
Compiling objects...
Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N)
[1/2] /usr/local/cuda-11.1/bin/nvcc --generate-dependencies-with-compile --dependency-output /home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/build/temp.linux-x86_64-3.6/pkg/src/cuda/emd.o.d -I/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include -I/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include -I/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/TH -I/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/THC -I/usr/local/cuda-11.1/include -I/home/wangweijia/anaconda3/envs/pcrnet/include/python3.6m -c -c /home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/src/cuda/emd.cu -o /home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/build/temp.linux-x86_64-3.6/pkg/src/cuda/emd.o -D__CUDA_NO_HALF_OPERATORS_ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=_emd -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86 -std=c++14
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda/emd.cuh(39): warning: specified alignment (4) is different from alignment (8) specified on a previous declaration
detected during instantiation of "void approx_match_kernel(int64_t, int64_t, int64_t, int64_t, const T *, const T *, T *, T *) [with T=float]"
(237): here
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda/emd.cuh(262): warning: specified alignment (4) is different from alignment (8) specified on a previous declaration
detected during instantiation of "void match_cost_kernel(int64_t, int64_t, int64_t, int64_t, const T *, const T *, const T *, T *) [with T=float]"
(318): here
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda/emd.cuh(342): warning: specified alignment (4) is different from alignment (8) specified on a previous declaration
detected during instantiation of "void match_cost_grad2_kernel(int64_t, int64_t, int64_t, int64_t, const T *, const T *, const T *, T *) [with T=float]"
(444): here
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda/emd.cuh: In lambda function:
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda/emd.cuh:237:43: warning: ‘at::DeprecatedTypeProperties& at::Tensor::type() const’ is deprecated: Tensor.type() is deprecated. Instead use Tensor.options(), which in many cases (e.g. in a constructor) is a drop-in replacement. If you were using data from type(), that is now available from Tensor itself, so instead of tensor.type().scalar_type(), use tensor.scalar_type() instead and instead of tensor.type().backend() use tensor.device(). [-Wdeprecated-declarations]
AT_DISPATCH_FLOATING_TYPES(match.type(), "approx_match_kernel", ([&] {
^
/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/ATen/core/TensorBody.h:303:1: note: declared here
DeprecatedTypeProperties & type() const {
^
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda/emd.cuh:237:98: warning: ‘c10::ScalarType detail::scalar_type(const at::DeprecatedTypeProperties&)’ is deprecated: passing at::DeprecatedTypeProperties to an AT_DISPATCH macro is deprecated, pass an at::ScalarType instead [-Wdeprecated-declarations]
/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/ATen/Dispatch.h:109:1: note: declared here
inline at::ScalarType scalar_type(const at::DeprecatedTypeProperties& t) {
^
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda/emd.cuh: In lambda function:
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda/emd.cuh:237:920: warning: ‘T* at::Tensor::data() const [with T = double]’ is deprecated: Tensor.data() is deprecated. Please use Tensor.data_ptr() instead. [-Wdeprecated-declarations]
/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/ATen/core/TensorBody.h:395:1: note: declared here
T * data() const {
^
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda/emd.cuh:237:945: warning: ‘T* at::Tensor::data() const [with T = double]’ is deprecated: Tensor.data() is deprecated. Please use Tensor.data_ptr() instead. [-Wdeprecated-declarations]
/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/ATen/core/TensorBody.h:395:1: note: declared here
T * data() const {
^
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda/emd.cuh:237:971: warning: ‘T* at::Tensor::data() const [with T = double]’ is deprecated: Tensor.data() is deprecated. Please use Tensor.data_ptr() instead. [-Wdeprecated-declarations]
/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/ATen/core/TensorBody.h:395:1: note: declared here
T * data() const {
^
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda/emd.cuh:237:996: warning: ‘T* at::Tensor::data() const [with T = double]’ is deprecated: Tensor.data() is deprecated. Please use Tensor.data_ptr() instead. [-Wdeprecated-declarations]
/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/ATen/core/TensorBody.h:395:1: note: declared here
T * data() const {
^
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda/emd.cuh: In lambda function:
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda/emd.cuh:237:1807: warning: ‘T* at::Tensor::data() const [with T = float]’ is deprecated: Tensor.data() is deprecated. Please use Tensor.data_ptr() instead. [-Wdeprecated-declarations]
/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/ATen/core/TensorBody.h:395:1: note: declared here
T * data() const {
^
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda/emd.cuh:237:1831: warning: ‘T* at::Tensor::data() const [with T = float]’ is deprecated: Tensor.data() is deprecated. Please use Tensor.data_ptr() instead. [-Wdeprecated-declarations]
/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/ATen/core/TensorBody.h:395:1: note: declared here
T * data() const {
^
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda/emd.cuh:237:1856: warning: ‘T* at::Tensor::data() const [with T = float]’ is deprecated: Tensor.data() is deprecated. Please use Tensor.data_ptr() instead. [-Wdeprecated-declarations]
/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/ATen/core/TensorBody.h:395:1: note: declared here
T * data() const {
^
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda/emd.cuh:237:1880: warning: ‘T* at::Tensor::data() const [with T = float]’ is deprecated: Tensor.data() is deprecated. Please use Tensor.data_ptr() instead. [-Wdeprecated-declarations]
/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/ATen/core/TensorBody.h:395:1: note: declared here
T * data() const {
^
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda/emd.cuh: In lambda function:
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda/emd.cuh:318:42: warning: ‘at::DeprecatedTypeProperties& at::Tensor::type() const’ is deprecated: Tensor.type() is deprecated. Instead use Tensor.options(), which in many cases (e.g. in a constructor) is a drop-in replacement. If you were using data from type(), that is now available from Tensor itself, so instead of tensor.type().scalar_type(), use tensor.scalar_type() instead and instead of tensor.type().backend() use tensor.device(). [-Wdeprecated-declarations]
AT_DISPATCH_FLOATING_TYPES(xyz1.type(), "match_cost_kernel", ([&] {
^
/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/ATen/core/TensorBody.h:303:1: note: declared here
DeprecatedTypeProperties & type() const {
^
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda/emd.cuh:318:97: warning: ‘c10::ScalarType detail::scalar_type(const at::DeprecatedTypeProperties&)’ is deprecated: passing at::DeprecatedTypeProperties to an AT_DISPATCH macro is deprecated, pass an at::ScalarType instead [-Wdeprecated-declarations]
/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/ATen/Dispatch.h:109:1: note: declared here
inline at::ScalarType scalar_type(const at::DeprecatedTypeProperties& t) {
^
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda/emd.cuh: In lambda function:
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda/emd.cuh:318:961: warning: ‘T* at::Tensor::data() const [with T = double]’ is deprecated: Tensor.data() is deprecated. Please use Tensor.data_ptr() instead. [-Wdeprecated-declarations]
/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/ATen/core/TensorBody.h:395:1: note: declared here
T * data() const {
^
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda/emd.cuh:318:986: warning: ‘T* at::Tensor::data() const [with T = double]’ is deprecated: Tensor.data() is deprecated. Please use Tensor.data_ptr() instead. [-Wdeprecated-declarations]
/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/ATen/core/TensorBody.h:395:1: note: declared here
T * data() const {
^
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda/emd.cuh:318:1012: warning: ‘T* at::Tensor::data() const [with T = double]’ is deprecated: Tensor.data() is deprecated. Please use Tensor.data_ptr() instead. [-Wdeprecated-declarations]
/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/ATen/core/TensorBody.h:395:1: note: declared here
T * data() const {
^
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda/emd.cuh:318:1036: warning: ‘T* at::Tensor::data() const [with T = double]’ is deprecated: Tensor.data() is deprecated. Please use Tensor.data_ptr() instead. [-Wdeprecated-declarations]
/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/ATen/core/TensorBody.h:395:1: note: declared here
T * data() const {
^
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda/emd.cuh: In lambda function:
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda/emd.cuh:318:1889: warning: ‘T* at::Tensor::data() const [with T = float]’ is deprecated: Tensor.data() is deprecated. Please use Tensor.data_ptr() instead. [-Wdeprecated-declarations]
/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/ATen/core/TensorBody.h:395:1: note: declared here
T * data() const {
^
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda/emd.cuh:318:1913: warning: ‘T* at::Tensor::data() const [with T = float]’ is deprecated: Tensor.data() is deprecated. Please use Tensor.data_ptr() instead. [-Wdeprecated-declarations]
/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/ATen/core/TensorBody.h:395:1: note: declared here
T * data() const {
^
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda/emd.cuh:318:1938: warning: ‘T* at::Tensor::data() const [with T = float]’ is deprecated: Tensor.data() is deprecated. Please use Tensor.data_ptr() instead. [-Wdeprecated-declarations]
/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/ATen/core/TensorBody.h:395:1: note: declared here
T * data() const {
^
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda/emd.cuh:318:1961: warning: ‘T* at::Tensor::data() const [with T = float]’ is deprecated: Tensor.data() is deprecated. Please use Tensor.data_ptr() instead. [-Wdeprecated-declarations]
/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/ATen/core/TensorBody.h:395:1: note: declared here
T * data() const {
^
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda/emd.cuh: In lambda function:
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda/emd.cuh:434:42: warning: ‘at::DeprecatedTypeProperties& at::Tensor::type() const’ is deprecated: Tensor.type() is deprecated. Instead use Tensor.options(), which in many cases (e.g. in a constructor) is a drop-in replacement. If you were using data from type(), that is now available from Tensor itself, so instead of tensor.type().scalar_type(), use tensor.scalar_type() instead and instead of tensor.type().backend() use tensor.device(). [-Wdeprecated-declarations]
AT_DISPATCH_FLOATING_TYPES(xyz1.type(), "match_cost_grad1_kernel", ([&] {
^
/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/ATen/core/TensorBody.h:303:1: note: declared here
DeprecatedTypeProperties & type() const {
^
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda/emd.cuh:434:97: warning: ‘c10::ScalarType detail::scalar_type(const at::DeprecatedTypeProperties&)’ is deprecated: passing at::DeprecatedTypeProperties to an AT_DISPATCH macro is deprecated, pass an at::ScalarType instead [-Wdeprecated-declarations]
/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/ATen/Dispatch.h:109:1: note: declared here
inline at::ScalarType scalar_type(const at::DeprecatedTypeProperties& t) {
^
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda/emd.cuh: In lambda function:
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda/emd.cuh:434:885: warning: ‘T* at::Tensor::data() const [with T = double]’ is deprecated: Tensor.data() is deprecated. Please use Tensor.data_ptr() instead. [-Wdeprecated-declarations]
/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/ATen/core/TensorBody.h:395:1: note: declared here
T * data() const {
^
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda/emd.cuh:434:910: warning: ‘T* at::Tensor::data() const [with T = double]’ is deprecated: Tensor.data() is deprecated. Please use Tensor.data_ptr() instead. [-Wdeprecated-declarations]
/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/ATen/core/TensorBody.h:395:1: note: declared here
T * data() const {
^
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda/emd.cuh:434:936: warning: ‘T* at::Tensor::data() const [with T = double]’ is deprecated: Tensor.data() is deprecated. Please use Tensor.data_ptr() instead. [-Wdeprecated-declarations]
/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/ATen/core/TensorBody.h:395:1: note: declared here
T * data() const {
^
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda/emd.cuh:434:962: warning: ‘T* at::Tensor::data() const [with T = double]’ is deprecated: Tensor.data() is deprecated. Please use Tensor.data_ptr() instead. [-Wdeprecated-declarations]
/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/ATen/core/TensorBody.h:395:1: note: declared here
T * data() const {
^
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda/emd.cuh: In lambda function:
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda/emd.cuh:434:1739: warning: ‘T* at::Tensor::data() const [with T = float]’ is deprecated: Tensor.data() is deprecated. Please use Tensor.data_ptr() instead. [-Wdeprecated-declarations]
/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/ATen/core/TensorBody.h:395:1: note: declared here
T * data() const {
^
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda/emd.cuh:434:1763: warning: ‘T* at::Tensor::data() const [with T = float]’ is deprecated: Tensor.data() is deprecated. Please use Tensor.data_ptr() instead. [-Wdeprecated-declarations]
/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/ATen/core/TensorBody.h:395:1: note: declared here
T * data() const {
^
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda/emd.cuh:434:1788: warning: ‘T* at::Tensor::data() const [with T = float]’ is deprecated: Tensor.data() is deprecated. Please use Tensor.data_ptr() instead. [-Wdeprecated-declarations]
/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/ATen/core/TensorBody.h:395:1: note: declared here
T * data() const {
^
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda/emd.cuh:434:1813: warning: ‘T* at::Tensor::data() const [with T = float]’ is deprecated: Tensor.data() is deprecated. Please use Tensor.data_ptr() instead. [-Wdeprecated-declarations]
/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/ATen/core/TensorBody.h:395:1: note: declared here
T * data() const {
^
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda/emd.cuh: In lambda function:
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda/emd.cuh:444:42: warning: ‘at::DeprecatedTypeProperties& at::Tensor::type() const’ is deprecated: Tensor.type() is deprecated. Instead use Tensor.options(), which in many cases (e.g. in a constructor) is a drop-in replacement. If you were using data from type(), that is now available from Tensor itself, so instead of tensor.type().scalar_type(), use tensor.scalar_type() instead and instead of tensor.type().backend() use tensor.device(). [-Wdeprecated-declarations]
AT_DISPATCH_FLOATING_TYPES(xyz1.type(), "match_cost_grad2_kernel", ([&] {
^
/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/ATen/core/TensorBody.h:303:1: note: declared here
DeprecatedTypeProperties & type() const {
^
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda/emd.cuh:444:97: warning: ‘c10::ScalarType detail::scalar_type(const at::DeprecatedTypeProperties&)’ is deprecated: passing at::DeprecatedTypeProperties to an AT_DISPATCH macro is deprecated, pass an at::ScalarType instead [-Wdeprecated-declarations]
/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/ATen/Dispatch.h:109:1: note: declared here
inline at::ScalarType scalar_type(const at::DeprecatedTypeProperties& t) {
^
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda/emd.cuh: In lambda function:
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda/emd.cuh:444:929: warning: ‘T* at::Tensor::data() const [with T = double]’ is deprecated: Tensor.data() is deprecated. Please use Tensor.data_ptr() instead. [-Wdeprecated-declarations]
/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/ATen/core/TensorBody.h:395:1: note: declared here
T * data() const {
^
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda/emd.cuh:444:954: warning: ‘T* at::Tensor::data() const [with T = double]’ is deprecated: Tensor.data() is deprecated. Please use Tensor.data_ptr() instead. [-Wdeprecated-declarations]
/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/ATen/core/TensorBody.h:395:1: note: declared here
T * data() const {
^
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda/emd.cuh:444:980: warning: ‘T* at::Tensor::data() const [with T = double]’ is deprecated: Tensor.data() is deprecated. Please use Tensor.data_ptr() instead. [-Wdeprecated-declarations]
/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/ATen/core/TensorBody.h:395:1: note: declared here
T * data() const {
^
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda/emd.cuh:444:1006: warning: ‘T* at::Tensor::data() const [with T = double]’ is deprecated: Tensor.data() is deprecated. Please use Tensor.data_ptr() instead. [-Wdeprecated-declarations]
/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/ATen/core/TensorBody.h:395:1: note: declared here
T * data() const {
^
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda/emd.cuh: In lambda function:
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda/emd.cuh:444:1827: warning: ‘T* at::Tensor::data() const [with T = float]’ is deprecated: Tensor.data() is deprecated. Please use Tensor.data_ptr() instead. [-Wdeprecated-declarations]
/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/ATen/core/TensorBody.h:395:1: note: declared here
T * data() const {
^
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda/emd.cuh:444:1851: warning: ‘T* at::Tensor::data() const [with T = float]’ is deprecated: Tensor.data() is deprecated. Please use Tensor.data_ptr() instead. [-Wdeprecated-declarations]
/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/ATen/core/TensorBody.h:395:1: note: declared here
T * data() const {
^
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda/emd.cuh:444:1876: warning: ‘T* at::Tensor::data() const [with T = float]’ is deprecated: Tensor.data() is deprecated. Please use Tensor.data_ptr() instead. [-Wdeprecated-declarations]
/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/ATen/core/TensorBody.h:395:1: note: declared here
T * data() const {
^
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda/emd.cuh:444:1901: warning: ‘T* at::Tensor::data() const [with T = float]’ is deprecated: Tensor.data() is deprecated. Please use Tensor.data_ptr() instead. [-Wdeprecated-declarations]
/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/ATen/core/TensorBody.h:395:1: note: declared here
T * data() const {
^
[2/2] c++ -MMD -MF /home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/build/temp.linux-x86_64-3.6/pkg/src/emd.o.d -pthread -B /home/wangweijia/anaconda3/envs/pcrnet/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include -I/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include -I/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/TH -I/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/THC -I/usr/local/cuda-11.1/include -I/home/wangweijia/anaconda3/envs/pcrnet/include/python3.6m -c -c /home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/src/emd.cpp -o /home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/build/temp.linux-x86_64-3.6/pkg/src/emd.o -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=_emd -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14
FAILED: /home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/build/temp.linux-x86_64-3.6/pkg/src/emd.o
c++ -MMD -MF /home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/build/temp.linux-x86_64-3.6/pkg/src/emd.o.d -pthread -B /home/wangweijia/anaconda3/envs/pcrnet/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include -I/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include -I/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/TH -I/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/THC -I/usr/local/cuda-11.1/include -I/home/wangweijia/anaconda3/envs/pcrnet/include/python3.6m -c -c /home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/src/emd.cpp -o /home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/build/temp.linux-x86_64-3.6/pkg/src/emd.o -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=_emd -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
In file included from /home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/ATen/Parallel.h:140:0,
from /home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/utils.h:3,
from /home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:5,
from /home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/nn.h:3,
from /home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/all.h:13,
from /home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/torch/extension.h:4,
from /home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/emd.h:4,
from /home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/src/emd.cpp:1:
/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/ATen/ParallelOpenMP.h:83:0: warning: ignoring #pragma omp parallel [-Wunknown-pragmas]
#pragma omp parallel for if ((end - begin) >= grain_size)
^
In file included from /home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/emd.h:7:0,
from /home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/src/emd.cpp:1:
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/emd.h: In function ‘std::vectorat::Tensor emd_forward(at::Tensor, at::Tensor)’:
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda_helper.h:12:39: warning: ‘at::DeprecatedTypeProperties& at::Tensor::type() const’ is deprecated: Tensor.type() is deprecated. Instead use Tensor.options(), which in many cases (e.g. in a constructor) is a drop-in replacement. If you were using data from type(), that is now available from Tensor itself, so instead of tensor.type().scalar_type(), use tensor.scalar_type() instead and instead of tensor.type().backend() use tensor.device(). [-Wdeprecated-declarations]
#define CHECK_CUDA(x) AT_CHECK(x.type().is_cuda(),
^
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda_helper.h:16:24: note: in expansion of macro ‘CHECK_CUDA’
#define CHECK_INPUT(x) CHECK_CUDA(x); CHECK_CONTIGUOUS(x)
^
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/emd.h:29:2: note: in expansion of macro ‘CHECK_INPUT’
CHECK_INPUT(xyz1);
^
In file included from /home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/ATen/Tensor.h:3:0,
from /home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/ATen/Context.h:4,
from /home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/ATen/ATen.h:9,
from /home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/types.h:3,
from /home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader_options.h:4,
from /home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/base.h:3,
from /home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/stateful.h:3,
from /home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader.h:3,
from /home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/data.h:3,
from /home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/all.h:8,
from /home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/torch/extension.h:4,
from /home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/emd.h:4,
from /home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/src/emd.cpp:1:
/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/ATen/core/TensorBody.h:303:30: note: declared here
DeprecatedTypeProperties & type() const {
^
In file included from /home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/emd.h:7:0,
from /home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/src/emd.cpp:1:
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda_helper.h:13:29: error: ‘AT_CHECK’ was not declared in this scope
#x " must be a CUDA tensor")
^
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda_helper.h:16:24: note: in expansion of macro ‘CHECK_CUDA’
#define CHECK_INPUT(x) CHECK_CUDA(x); CHECK_CONTIGUOUS(x)
^
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/emd.h:29:2: note: in expansion of macro ‘CHECK_INPUT’
CHECK_INPUT(xyz1);
^
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda_helper.h:12:39: warning: ‘at::DeprecatedTypeProperties& at::Tensor::type() const’ is deprecated: Tensor.type() is deprecated. Instead use Tensor.options(), which in many cases (e.g. in a constructor) is a drop-in replacement. If you were using data from type(), that is now available from Tensor itself, so instead of tensor.type().scalar_type(), use tensor.scalar_type() instead and instead of tensor.type().backend() use tensor.device(). [-Wdeprecated-declarations]
#define CHECK_CUDA(x) AT_CHECK(x.type().is_cuda(),
^
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda_helper.h:16:24: note: in expansion of macro ‘CHECK_CUDA’
#define CHECK_INPUT(x) CHECK_CUDA(x); CHECK_CONTIGUOUS(x)
^
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/emd.h:30:2: note: in expansion of macro ‘CHECK_INPUT’
CHECK_INPUT(xyz2);
^
In file included from /home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/ATen/Tensor.h:3:0,
from /home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/ATen/Context.h:4,
from /home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/ATen/ATen.h:9,
from /home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/types.h:3,
from /home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader_options.h:4,
from /home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/base.h:3,
from /home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/stateful.h:3,
from /home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader.h:3,
from /home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/data.h:3,
from /home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/all.h:8,
from /home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/torch/extension.h:4,
from /home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/emd.h:4,
from /home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/src/emd.cpp:1:
/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/ATen/core/TensorBody.h:303:30: note: declared here
DeprecatedTypeProperties & type() const {
^
In file included from /home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/emd.h:7:0,
from /home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/src/emd.cpp:1:
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/emd.h: In function ‘std::vectorat::Tensor emd_backward(at::Tensor, at::Tensor, at::Tensor)’:
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda_helper.h:12:39: warning: ‘at::DeprecatedTypeProperties& at::Tensor::type() const’ is deprecated: Tensor.type() is deprecated. Instead use Tensor.options(), which in many cases (e.g. in a constructor) is a drop-in replacement. If you were using data from type(), that is now available from Tensor itself, so instead of tensor.type().scalar_type(), use tensor.scalar_type() instead and instead of tensor.type().backend() use tensor.device(). [-Wdeprecated-declarations]
#define CHECK_CUDA(x) AT_CHECK(x.type().is_cuda(),
^
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda_helper.h:16:24: note: in expansion of macro ‘CHECK_CUDA’
#define CHECK_INPUT(x) CHECK_CUDA(x); CHECK_CONTIGUOUS(x)
^
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/emd.h:40:2: note: in expansion of macro ‘CHECK_INPUT’
CHECK_INPUT(xyz1);
^
In file included from /home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/ATen/Tensor.h:3:0,
from /home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/ATen/Context.h:4,
from /home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/ATen/ATen.h:9,
from /home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/types.h:3,
from /home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader_options.h:4,
from /home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/base.h:3,
from /home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/stateful.h:3,
from /home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader.h:3,
from /home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/data.h:3,
from /home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/all.h:8,
from /home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/torch/extension.h:4,
from /home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/emd.h:4,
from /home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/src/emd.cpp:1:
/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/ATen/core/TensorBody.h:303:30: note: declared here
DeprecatedTypeProperties & type() const {
^
In file included from /home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/emd.h:7:0,
from /home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/src/emd.cpp:1:
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda_helper.h:13:29: error: ‘AT_CHECK’ was not declared in this scope
#x " must be a CUDA tensor")
^
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda_helper.h:16:24: note: in expansion of macro ‘CHECK_CUDA’
#define CHECK_INPUT(x) CHECK_CUDA(x); CHECK_CONTIGUOUS(x)
^
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/emd.h:40:2: note: in expansion of macro ‘CHECK_INPUT’
CHECK_INPUT(xyz1);
^
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda_helper.h:12:39: warning: ‘at::DeprecatedTypeProperties& at::Tensor::type() const’ is deprecated: Tensor.type() is deprecated. Instead use Tensor.options(), which in many cases (e.g. in a constructor) is a drop-in replacement. If you were using data from type(), that is now available from Tensor itself, so instead of tensor.type().scalar_type(), use tensor.scalar_type() instead and instead of tensor.type().backend() use tensor.device(). [-Wdeprecated-declarations]
#define CHECK_CUDA(x) AT_CHECK(x.type().is_cuda(),
^
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda_helper.h:16:24: note: in expansion of macro ‘CHECK_CUDA’
#define CHECK_INPUT(x) CHECK_CUDA(x); CHECK_CONTIGUOUS(x)
^
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/emd.h:41:2: note: in expansion of macro ‘CHECK_INPUT’
CHECK_INPUT(xyz2);
^
In file included from /home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/ATen/Tensor.h:3:0,
from /home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/ATen/Context.h:4,
from /home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/ATen/ATen.h:9,
from /home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/types.h:3,
from /home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader_options.h:4,
from /home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/base.h:3,
from /home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/stateful.h:3,
from /home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader.h:3,
from /home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/data.h:3,
from /home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/all.h:8,
from /home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/torch/extension.h:4,
from /home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/emd.h:4,
from /home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/src/emd.cpp:1:
/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/ATen/core/TensorBody.h:303:30: note: declared here
DeprecatedTypeProperties & type() const {
^
In file included from /home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/emd.h:7:0,
from /home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/src/emd.cpp:1:
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda_helper.h:12:39: warning: ‘at::DeprecatedTypeProperties& at::Tensor::type() const’ is deprecated: Tensor.type() is deprecated. Instead use Tensor.options(), which in many cases (e.g. in a constructor) is a drop-in replacement. If you were using data from type(), that is now available from Tensor itself, so instead of tensor.type().scalar_type(), use tensor.scalar_type() instead and instead of tensor.type().backend() use tensor.device(). [-Wdeprecated-declarations]
#define CHECK_CUDA(x) AT_CHECK(x.type().is_cuda(),
^
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/cuda_helper.h:16:24: note: in expansion of macro ‘CHECK_CUDA’
#define CHECK_INPUT(x) CHECK_CUDA(x); CHECK_CONTIGUOUS(x)
^
/home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/emd.h:42:2: note: in expansion of macro ‘CHECK_INPUT’
CHECK_INPUT(match);
^
In file included from /home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/ATen/Tensor.h:3:0,
from /home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/ATen/Context.h:4,
from /home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/ATen/ATen.h:9,
from /home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/types.h:3,
from /home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader_options.h:4,
from /home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/base.h:3,
from /home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/stateful.h:3,
from /home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader.h:3,
from /home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/data.h:3,
from /home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/all.h:8,
from /home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/torch/extension.h:4,
from /home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/include/emd.h:4,
from /home/wangweijia/Desktop/Projects/PyTorch-EMDLoss-master/pkg/src/emd.cpp:1:
/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/include/ATen/core/TensorBody.h:303:30: note: declared here
DeprecatedTypeProperties & type() const {
^
ninja: build stopped: subcommand failed.
Traceback (most recent call last):
File "/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 1673, in _run_ninja_build
env=env)
File "/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/subprocess.py", line 438, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "setup.py", line 28, in
cmdclass={'build_ext': BuildExtension},
File "/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/setuptools/init.py", line 153, in setup
return distutils.core.setup(**attrs)
File "/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/distutils/core.py", line 148, in setup
dist.run_commands()
File "/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/setuptools/command/install.py", line 67, in run
self.do_egg_install()
File "/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/setuptools/command/install.py", line 109, in do_egg_install
self.run_command('bdist_egg')
File "/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/setuptools/command/bdist_egg.py", line 164, in run
cmd = self.call_command('install_lib', warn_dir=0)
File "/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/setuptools/command/bdist_egg.py", line 150, in call_command
self.run_command(cmdname)
File "/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/setuptools/command/install_lib.py", line 11, in run
self.build()
File "/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/distutils/command/install_lib.py", line 107, in build
self.run_command('build_ext')
File "/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/setuptools/command/build_ext.py", line 79, in run
_build_ext.run(self)
File "/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/distutils/command/build_ext.py", line 339, in run
self.build_extensions()
File "/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 708, in build_extensions
build_ext.build_extensions(self)
File "/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/distutils/command/build_ext.py", line 448, in build_extensions
self._build_extensions_serial()
File "/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/distutils/command/build_ext.py", line 473, in _build_extensions_serial
self.build_extension(ext)
File "/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/setuptools/command/build_ext.py", line 202, in build_extension
_build_ext.build_extension(self, ext)
File "/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/distutils/command/build_ext.py", line 533, in build_extension
depends=ext.depends)
File "/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 538, in unix_wrap_ninja_compile
with_cuda=with_cuda)
File "/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 1359, in _write_ninja_file_and_compile_objects
error_prefix='Error compiling objects for extension')
File "/home/wangweijia/anaconda3/envs/pcrnet/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 1683, in _run_ninja_build
raise RuntimeError(message) from e
RuntimeError: Error compiling objects for extension
Compilation failed for me. I get the following warnings and errors:
running install
running bdist_egg
running egg_info
creating PyTorch_EMD.egg-info
writing PyTorch_EMD.egg-info/PKG-INFO
writing dependency_links to PyTorch_EMD.egg-info/dependency_links.txt
writing top-level names to PyTorch_EMD.egg-info/top_level.txt
writing manifest file 'PyTorch_EMD.egg-info/SOURCES.txt'
reading manifest file 'PyTorch_EMD.egg-info/SOURCES.txt'
writing manifest file 'PyTorch_EMD.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
creating build
creating build/lib.linux-x86_64-3.7
creating build/lib.linux-x86_64-3.7/emd
copying pkg/layer/emd_loss_layer.py -> build/lib.linux-x86_64-3.7/emd
copying pkg/layer/__init__.py -> build/lib.linux-x86_64-3.7/emd
running build_ext
building '_emd' extension
creating build/temp.linux-x86_64-3.7
creating build/temp.linux-x86_64-3.7/pkg
creating build/temp.linux-x86_64-3.7/pkg/src
creating build/temp.linux-x86_64-3.7/pkg/src/cuda
gcc -pthread -B /mnt/171D5FBC6E8E9B9A/anaconda3/envs/torch/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Ipkg/include -I/mnt/171D5FBC6E8E9B9A/anaconda3/envs/torch/lib/python3.7/site-packages/torch/lib/include -I/mnt/171D5FBC6E8E9B9A/anaconda3/envs/torch/lib/python3.7/site-packages/torch/lib/include/torch/csrc/api/include -I/mnt/171D5FBC6E8E9B9A/anaconda3/envs/torch/lib/python3.7/site-packages/torch/lib/include/TH -I/mnt/171D5FBC6E8E9B9A/anaconda3/envs/torch/lib/python3.7/site-packages/torch/lib/include/THC -I/usr/local/cuda/include -I/mnt/171D5FBC6E8E9B9A/anaconda3/envs/torch/include/python3.7m -c pkg/src/emd.cpp -o build/temp.linux-x86_64-3.7/pkg/src/emd.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_emd -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
/usr/local/cuda/bin/nvcc -Ipkg/include -I/mnt/171D5FBC6E8E9B9A/anaconda3/envs/torch/lib/python3.7/site-packages/torch/lib/include -I/mnt/171D5FBC6E8E9B9A/anaconda3/envs/torch/lib/python3.7/site-packages/torch/lib/include/torch/csrc/api/include -I/mnt/171D5FBC6E8E9B9A/anaconda3/envs/torch/lib/python3.7/site-packages/torch/lib/include/TH -I/mnt/171D5FBC6E8E9B9A/anaconda3/envs/torch/lib/python3.7/site-packages/torch/lib/include/THC -I/usr/local/cuda/include -I/mnt/171D5FBC6E8E9B9A/anaconda3/envs/torch/include/python3.7m -c pkg/src/cuda/emd.cu -o build/temp.linux-x86_64-3.7/pkg/src/cuda/emd.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_emd -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
pkg/include/cuda/emd.cuh(39): warning: specified alignment (4) is different from alignment (8) specified on a previous declaration
detected during instantiation of "void approx_match_kernel(int64_t, int64_t, int64_t, int64_t, const T *, const T *, T *, T *) [with T=float]"
(237): here
pkg/include/cuda/emd.cuh(262): warning: specified alignment (4) is different from alignment (8) specified on a previous declaration
detected during instantiation of "void match_cost_kernel(int64_t, int64_t, int64_t, int64_t, const T *, const T *, const T *, T *) [with T=float]"
(318): here
pkg/include/cuda/emd.cuh(342): warning: specified alignment (4) is different from alignment (8) specified on a previous declaration
detected during instantiation of "void match_cost_grad2_kernel(int64_t, int64_t, int64_t, int64_t, const T *, const T *, const T *, T *) [with T=float]"
(444): here
pkg/include/cuda/emd.cuh(168): error: calling a __host__ function("std::fmax<double, float> ") from a __global__ function("approx_match_kernel<float> ") is not allowed
pkg/include/cuda/emd.cuh(168): error: identifier "std::fmax<double, float> " is undefined in device code
2 errors detected in the compilation of "/tmp/tmpxft_000035dc_00000000-6_emd.cpp1.ii".
I'm using Ubuntu 18.10, pytorch 1.0.1 and CUDA 10.0 with a GeForce GTX 1080.
Are these errors a bug, or have I missed something in the installation procedure?
I tried to built this on Ubuntu 18.04. Unfortunately I'm hit with the following error when invoking python setup.py install
:
building '_emd' extension
gcc -pthread -B /home/user/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Ipkg/include -I/home/user/.local/lib/python3.6/site-packages/torch/lib/include -I/home/user/.local/lib/python3.6/site-packages/torch/lib/include/torch/csrc/api/include -I/home/user/.local/lib/python3.6/site-packages/torch/lib/include/TH -I/home/user/.local/lib/python3.6/site-packages/torch/lib/include/THC -I/usr/local/cuda/include -I/home/user/anaconda3/include/python3.6m -c pkg/src/emd.cpp -o build/temp.linux-x86_64-3.6/pkg/src/emd.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_emd -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
/usr/local/cuda/bin/nvcc -Ipkg/include -I/home/user/.local/lib/python3.6/site-packages/torch/lib/include -I/home/user/.local/lib/python3.6/site-packages/torch/lib/include/torch/csrc/api/include -I/home/user/.local/lib/python3.6/site-packages/torch/lib/include/TH -I/home/user/.local/lib/python3.6/site-packages/torch/lib/include/THC -I/usr/local/cuda/include -I/home/user/anaconda3/include/python3.6m -c pkg/src/cuda/emd.cu -o build/temp.linux-x86_64-3.6/pkg/src/cuda/emd.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_emd -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
In file included from /usr/local/cuda/include/host_config.h:50:0,
from /usr/local/cuda/include/cuda_runtime.h:78,
from <command-line>:0:
/usr/local/cuda/include/crt/host_config.h:119:2: error: #error -- unsupported GNU version! gcc versions later than 6 are not supported!
#error -- unsupported GNU version! gcc versions later than 6 are not supported!
^~~~~
error: command '/usr/local/cuda/bin/nvcc' failed with exit status 1
The directory /usr/local/cuda
links to /usr/local/cuda-9.0
. I installed CUDA v9.0 through the package cuda-toolkit-9-0
from the following repository:
deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64 /
I installed PyTorch v1.0.0 through Anaconda like so:
conda install pytorch torchvision -c pytorch
What am I doing wrong? Sorry if this is the wrong place to ask. I'd happily accept a nudge to some other kind of documentation.
The gradient computation is incorrect. Test code:
import numpy as np
import torch
import time
from emd import EMDLoss
dist = EMDLoss()
xs = np.linspace(10, 50, 41)
ys = np.linspace(10, 50, 41)
l1 = np.stack((xs, np.ones(41)*10)).transpose()
l2 = np.stack((xs, np.ones(41)*50)).transpose()
l3 = np.stack((np.ones(41)*10, ys)).transpose()
l4 = np.stack((np.ones(41)*50, ys)).transpose()
p1 = np.concatenate((l1,l2,l3,l4))
npts = len(p1)
p1 = torch.from_numpy(p1).cuda().unsqueeze_(0)
for i in range(-3, 3):
print('offset: ', i)
p2 = p1 + i
p1.requires_grad = True
cost1 = dist(p1, p2)
print('\tdistance: ', cost1.data.cpu().numpy()[0])
loss = torch.sum(cost1)/npts
loss.backward()
print('\tgradient: ', p1.grad.data.cpu().numpy()[0][0])
Run script, the output looks like this:
offset: -3
distance: 489.7591609045162
gradient: [0.48759389 0.48759389]
offset: -2
distance: 323.4196924319101
gradient: [8124.4279909 6355.79031227]
offset: -1
distance: 162.74898605187073
gradient: [14667.35957541 11995.79261712]
offset: 0
distance: 0.0
gradient: [6.25019588e+08 6.25016916e+08]
offset: 1
distance: 162.7489860518707
gradient: [6.25026458e+08 6.25022920e+08]
offset: 2
distance: 323.41969243191016
gradient: [6.25035163e+08 6.25029917e+08]
The gradient is always positive when offset is both positive and negative, gradient is none zero when offset = 0.
Hi Marc,
Thank you for sharing this code. I am wondering if this code can be used to compare two grayscale image? I google for long time. But i don't find the solution.
Looking for your reply,
Thanks,
I've written a gist, trying to compare scipy.stats.wasserstein_distance
with the EMDLoss
implemented here. Unfortunately it seems like I'm using the implementation in a wrong way, because the values differ for the following test signals:
(x, y) | EL | WD |
---|---|---|
(a, b) | 0.04349525 | 0.0 |
(a, c) | 0.46960036 | 0.12115367548619291 |
(b, c) | 0.89565078 | 0.12115367548619291 |
Shouldn't EMDLoss and SciPy's Wasserstein Distance actually take on the same values? Am I wrong about the conversion of the signals through signal[None, :, None]
? I tried mimicking the shapes from test_emd_loss.py
, but don't quite grasp how this can be transferred to 1D signals.
Thanks
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.