Code Monkey home page Code Monkey logo

Comments (2)

himabindu13198 avatar himabindu13198 commented on June 6, 2024

I also have a similar error, but downgrading Pytorch to 0.4.1 did not solve the issue for me.
May I know the versions of your CUDA, g++ and OS please?
Mine are :
Ubuntu: 16.04
CUDA: 9.0.176
Pytorch: 0.4.1
g++ --version: 7.3.0

/opt/anaconda3/lib/python3.6/site-packages/torch/utils/cpp_extension.py:114: UserWarning:

                           !! WARNING !!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Your compiler (c++) may be ABI-incompatible with PyTorch!
Please use a compiler that is ABI-compatible with GCC 4.9 and above.
See https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html.

See https://gist.github.com/goldsborough/d466f43e8ffc948ff92de7486c5216d6
for instructions on how to install GCC 4.9 or higher.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

                          !! WARNING !!

warnings.warn(ABI_INCOMPATIBILITY_WARNING.format(compiler))


CalledProcessError Traceback (most recent call last)
/opt/anaconda3/lib/python3.6/site-packages/torch/utils/cpp_extension.py in _build_extension_module(name, build_directory)
738 subprocess.check_output(
--> 739 ['ninja', '-v'], stderr=subprocess.STDOUT, cwd=build_directory)
740 except subprocess.CalledProcessError:

/opt/anaconda3/lib/python3.6/subprocess.py in check_output(timeout, *popenargs, **kwargs)
355 return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
--> 356 **kwargs).stdout
357

/opt/anaconda3/lib/python3.6/subprocess.py in run(input, timeout, check, *popenargs, **kwargs)
437 raise CalledProcessError(retcode, process.args,
--> 438 output=stdout, stderr=stderr)
439 return CompletedProcess(process.args, retcode, stdout, stderr)

CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

RuntimeError Traceback (most recent call last)
in
----> 1 from models.ternausnet2 import TernausNetV2

~/TernausNetV2/models/ternausnet2.py in
9 from torch.nn import Sequential
10 from collections import OrderedDict
---> 11 from modules.bn import ABN
12
13 from modules.wider_resnet import WiderResNet

~/TernausNetV2/modules/bn.py in
7 from queue import Queue
8
----> 9 from .functions import (ACT_ELU, ACT_RELU, ACT_LEAKY_RELU, inplace_abn, inplace_abn_sync)
10
11

~/TernausNetV2/modules/functions.py in
16 "inplace_abn_cuda.cu"
17 ]],
---> 18 extra_cuda_cflags=["--expt-extended-lambda"])
19
20 # Activation names

/opt/anaconda3/lib/python3.6/site-packages/torch/utils/cpp_extension.py in load(name, sources, extra_cflags, extra_cuda_cflags, extra_ldflags, extra_include_paths, build_directory, verbose, with_cuda)
492 build_directory or _get_build_directory(name, verbose),
493 verbose,
--> 494 with_cuda=with_cuda)
495
496

/opt/anaconda3/lib/python3.6/site-packages/torch/utils/cpp_extension.py in _jit_compile(name, sources, extra_cflags, extra_cuda_cflags, extra_ldflags, extra_include_paths, build_directory, verbose, with_cuda)
660 if verbose:
661 print('Building extension module {}...'.format(name))
--> 662 _build_extension_module(name, build_directory)
663 finally:
664 baton.release()

/opt/anaconda3/lib/python3.6/site-packages/torch/utils/cpp_extension.py in _build_extension_module(name, build_directory)
743 # error.output contains the stdout and stderr of the build attempt.
744 raise RuntimeError("Error building extension '{}': {}".format(
--> 745 name, error.output.decode()))
746
747

RuntimeError: Error building extension 'inplace_abn': [1/4] /opt/anaconda3/lib/python3.6/site-packages/torch/cuda/bin/nvcc -DTORCH_EXTENSION_NAME=inplace_abn -I/opt/anaconda3/lib/python3.6/site-packages/torch/lib/include -I/opt/anaconda3/lib/python3.6/site-packages/torch/lib/include/TH -I/opt/anaconda3/lib/python3.6/site-packages/torch/lib/include/THC -I/opt/anaconda3/lib/python3.6/site-packages/torch/cuda/include -I/opt/anaconda3/include/python3.6m --compiler-options '-fPIC' --expt-extended-lambda -std=c++11 -c /home/ubuntu/TernausNetV2/modules/src/inplace_abn_cuda.cu -o inplace_abn_cuda.cuda.o
FAILED: inplace_abn_cuda.cuda.o
/opt/anaconda3/lib/python3.6/site-packages/torch/cuda/bin/nvcc -DTORCH_EXTENSION_NAME=inplace_abn -I/opt/anaconda3/lib/python3.6/site-packages/torch/lib/include -I/opt/anaconda3/lib/python3.6/site-packages/torch/lib/include/TH -I/opt/anaconda3/lib/python3.6/site-packages/torch/lib/include/THC -I/opt/anaconda3/lib/python3.6/site-packages/torch/cuda/include -I/opt/anaconda3/include/python3.6m --compiler-options '-fPIC' --expt-extended-lambda -std=c++11 -c /home/ubuntu/TernausNetV2/modules/src/inplace_abn_cuda.cu -o inplace_abn_cuda.cuda.o
/bin/sh: 1: /opt/anaconda3/lib/python3.6/site-packages/torch/cuda/bin/nvcc: not found
[2/4] c++ -MMD -MF inplace_abn_cpu.o.d -DTORCH_EXTENSION_NAME=inplace_abn -I/opt/anaconda3/lib/python3.6/site-packages/torch/lib/include -I/opt/anaconda3/lib/python3.6/site-packages/torch/lib/include/TH -I/opt/anaconda3/lib/python3.6/site-packages/torch/lib/include/THC -I/opt/anaconda3/lib/python3.6/site-packages/torch/cuda/include -I/opt/anaconda3/include/python3.6m -fPIC -std=c++11 -O3 -c /home/ubuntu/TernausNetV2/modules/src/inplace_abn_cpu.cpp -o inplace_abn_cpu.o
/home/ubuntu/TernausNetV2/modules/src/inplace_abn_cpu.cpp: In function 'std::vectorat::Tensor backward_cpu(at::Tensor, at::Tensor, at::Tensor, at::Tensor, at::Tensor, at::Tensor, at::Tensor, bool, float)':
/home/ubuntu/TernausNetV2/modules/src/inplace_abn_cpu.cpp:82:41: warning: 'at::Tensor at::empty(const at::Type&, at::IntList)' is deprecated [-Wdeprecated-declarations]
auto dweight = at::empty(z.type(), {0});
^
In file included from /opt/anaconda3/lib/python3.6/site-packages/torch/lib/include/ATen/ATen.h:14:0,
from /home/ubuntu/TernausNetV2/modules/src/inplace_abn_cpu.cpp:1:
/opt/anaconda3/lib/python3.6/site-packages/torch/lib/include/ATen/Functions.h:3521:22: note: declared here
static inline Tensor empty(const Type & dtype, IntList size) {
^~~~~
/home/ubuntu/TernausNetV2/modules/src/inplace_abn_cpu.cpp:83:39: warning: 'at::Tensor at::empty(const at::Type&, at::IntList)' is deprecated [-Wdeprecated-declarations]
auto dbias = at::empty(z.type(), {0});
^
In file included from /opt/anaconda3/lib/python3.6/site-packages/torch/lib/include/ATen/ATen.h:14:0,
from /home/ubuntu/TernausNetV2/modules/src/inplace_abn_cpu.cpp:1:
/opt/anaconda3/lib/python3.6/site-packages/torch/lib/include/ATen/Functions.h:3521:22: note: declared here
static inline Tensor empty(const Type & dtype, IntList size) {
^~~~~
[3/4] c++ -MMD -MF inplace_abn.o.d -DTORCH_EXTENSION_NAME=inplace_abn -I/opt/anaconda3/lib/python3.6/site-packages/torch/lib/include -I/opt/anaconda3/lib/python3.6/site-packages/torch/lib/include/TH -I/opt/anaconda3/lib/python3.6/site-packages/torch/lib/include/THC -I/opt/anaconda3/lib/python3.6/site-packages/torch/cuda/include -I/opt/anaconda3/include/python3.6m -fPIC -std=c++11 -O3 -c /home/ubuntu/TernausNetV2/modules/src/inplace_abn.cpp -o inplace_abn.o
ninja: build stopped: subcommand failed.

def get_model(model_path):

model = TernausNetV2(num_classes=2)

state = torch.load('weights/deepglobe_building

from ternausnetv2.

piyush-jaiswal avatar piyush-jaiswal commented on June 6, 2024

Hi, these were my settings while importing:
Ubuntu: 16.04
g++: 5.5
CUDA: 9.2

Although, this seems like a ninja error to me. I would recommend you do the following incrementally and check:

  • apt-get install ninja-build
  • downgrade gcc version to 5.*. This installation guide recommends gcc 5.4 for Ubuntu 16.04.
  • Upgrade your CUDA version to 9.2.

from ternausnetv2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.