Detectron: Dockerのインストールが次のように失敗します:「 'numel'という名前のメンバーがありません」

作成日 2018年11月19日  ·  13コメント  ·  ソース: facebookresearch/Detectron

こんにちは、みんな、
最近、Dockerを介してdetectronをインストールする際に問題が発生しました。 私は今失敗します:

/usr/local/caffe2_build/include/caffe2/core/tensor.h:687:17:注:候補者は1つの引数を期待し、0が提供されます
/detectron/detectron/ops/zero_even_op.cc:33:27:エラー: 'class caffe2 :: Tensor <:cpucontext i = "7">'には 'numel'という名前のメンバーがありません
for(auto i = 0; i <Y-> numel(); i + = 2){

ここで関連する問題を見つけました:
https://github.com/facebookresearch/Detectron/issues/732
しかし、detectronがリポジトリから直接インストールしているため、修正を使用できません。 リポジトリを変更していただけませんか?
前もって感謝します、

エリック

最も参考になるコメント

最新のマスターの代わりにd56e267をチェックアウトすることでこれを機能させることができました

あなたはDockerfileで意味しますか? 例えば

git clone https://github.com/facebookresearch/detectron / detectronを実行します
実行cd / detectron && gitチェックアウトd56e267

全てのコメント13件

こんにちは、私はDockerfileで同じ問題を抱えています。 それがCUDAバージョンに関係しているのではないかと思います。

コンパイルは現在壊れています。 これを取得する:
Docker Hubのどこかに、これのサポートされている自動ビルドはありませんか?

私のシステムには、CUDAを使用して正常に動作する他のコンテナーがあります。

-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- CUDA detected: 9.0
-- Added CUDA NVCC flags for: sm_30 sm_35 sm_50 sm_52 sm_60 sm_61 sm_70
-- Found libcuda: /usr/local/cuda/lib64/stubs/libcuda.so
-- Found libnvrtc: /usr/local/cuda/lib64/libnvrtc.so
-- Found CUDNN: /usr/include  
-- Found cuDNN: v7.0.5  (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libcudnn.so)
-- Summary:
--   CMake version        : 3.5.1
--   CMake command        : /usr/bin/cmake
--   System name          : Linux
--   C++ compiler         : /usr/bin/c++
--   C++ compiler version : 5.4.0
--   CXX flags            :  -std=c++11 -O2 -fPIC -Wno-narrowing
--   Caffe2 version       : 0.8.1
--   Caffe2 include path  : /usr/local/caffe2_build/include
--   Have CUDA            : TRUE
--     CUDA version       : 9.0
--     CuDNN version      : 7.0.5
-- Configuring done
-- Generating done
-- Build files have been written to: /detectron/build
make[1]: Entering directory '/detectron/build'
make[2]: Entering directory '/detectron/build'
make[3]: Entering directory '/detectron/build'
make[3]: Entering directory '/detectron/build'
[ 20%] Building NVCC (Device) object CMakeFiles/caffe2_detectron_custom_ops_gpu.dir/detectron/ops/caffe2_detectron_custom_ops_gpu_generated_zero_even_op.cu.o
Scanning dependencies of target caffe2_detectron_custom_ops
make[3]: Leaving directory '/detectron/build'
make[3]: Entering directory '/detectron/build'
[ 40%] Building CXX object CMakeFiles/caffe2_detectron_custom_ops.dir/detectron/ops/zero_even_op.cc.o
In file included from /usr/local/caffe2_build/include/caffe2/core/allocator.h:22:0,
                 from /usr/local/caffe2_build/include/caffe2/core/context.h:25,                                                                     
                 from /detectron/detectron/ops/zero_even_op.h:20,                                                                                   
                 from /detectron/detectron/ops/zero_even_op.cc:17:                                                                                  
/detectron/detectron/ops/zero_even_op.cc: In member function 'bool caffe2::ZeroEvenOp<T, Context>::RunOnDevice() [with T = float; Context = caffe2::CPUContext]':                                                                                                                                       
/detectron/detectron/ops/zero_even_op.cc:25:23: error: no matching function for call to 'caffe2::Tensor<caffe2::CPUContext>::dim() const'           
   CAFFE_ENFORCE(X.dim() == 1);                                                                                                                     
                       ^                                                                                                                            
In file included from /usr/local/caffe2_build/include/caffe2/core/net.h:34:0,                                                                       
                 from /usr/local/caffe2_build/include/caffe2/core/operator.h:29,                                                                    
                 from /detectron/detectron/ops/zero_even_op.h:21,                                                                                   
                 from /detectron/detectron/ops/zero_even_op.cc:17:                                                                                  
/usr/local/caffe2_build/include/caffe2/core/tensor.h:687:17: note: candidate: caffe2::TIndex caffe2::Tensor<Context>::dim(int) const [with Context = caffe2::CPUContext; caffe2::TIndex = long int]                                                                                                     
   inline TIndex dim(const int i) const {                                                                                                           
                 ^                                                                                                                                  
/usr/local/caffe2_build/include/caffe2/core/tensor.h:687:17: note:   candidate expects 1 argument, 0 provided                                       
/detectron/detectron/ops/zero_even_op.cc:33:27: error: 'class caffe2::Tensor<caffe2::CPUContext>' has no member named 'numel'                       
   for (auto i = 0; i < Y->numel(); i += 2) {                                                                                                       
                           ^                                                                                                                        
CMakeFiles/caffe2_detectron_custom_ops.dir/build.make:62: recipe for target 'CMakeFiles/caffe2_detectron_custom_ops.dir/detectron/ops/zero_even_op.cc.o' failed
make[3]: *** [CMakeFiles/caffe2_detectron_custom_ops.dir/detectron/ops/zero_even_op.cc.o] Error 1
make[3]: Leaving directory '/detectron/build'
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/caffe2_detectron_custom_ops.dir/all' failed
make[2]: *** [CMakeFiles/caffe2_detectron_custom_ops.dir/all] Error 2
make[2]: *** Waiting for unfinished jobs....                                                                                                        
Scanning dependencies of target caffe2_detectron_custom_ops_gpu
make[3]: Leaving directory '/detectron/build'
make[3]: Entering directory '/detectron/build'
[ 60%] Building CXX object CMakeFiles/caffe2_detectron_custom_ops_gpu.dir/detectron/ops/zero_even_op.cc.o
In file included from /usr/local/caffe2_build/include/caffe2/core/allocator.h:22:0,
                 from /usr/local/caffe2_build/include/caffe2/core/context.h:25,                                                                     
                 from /detectron/detectron/ops/zero_even_op.h:20,
                 from /detectron/detectron/ops/zero_even_op.cc:17:
/detectron/detectron/ops/zero_even_op.cc: In member function 'bool caffe2::ZeroEvenOp<T, Context>::RunOnDevice() [with T = float; Context = caffe2::CPUContext]':
/detectron/detectron/ops/zero_even_op.cc:25:23: error: no matching function for call to 'caffe2::Tensor<caffe2::CPUContext>::dim() const'
   CAFFE_ENFORCE(X.dim() == 1);
                       ^
In file included from /usr/local/caffe2_build/include/caffe2/core/net.h:34:0,
                 from /usr/local/caffe2_build/include/caffe2/core/operator.h:29,
                 from /detectron/detectron/ops/zero_even_op.h:21,
                 from /detectron/detectron/ops/zero_even_op.cc:17:
/usr/local/caffe2_build/include/caffe2/core/tensor.h:687:17: note: candidate: caffe2::TIndex caffe2::Tensor<Context>::dim(int) const [with Context = caffe2::CPUContext; caffe2::TIndex = long int]
   inline TIndex dim(const int i) const {
                 ^
/usr/local/caffe2_build/include/caffe2/core/tensor.h:687:17: note:   candidate expects 1 argument, 0 provided
/detectron/detectron/ops/zero_even_op.cc:33:27: error: 'class caffe2::Tensor<caffe2::CPUContext>' has no member named 'numel'
   for (auto i = 0; i < Y->numel(); i += 2) {
                           ^
CMakeFiles/caffe2_detectron_custom_ops_gpu.dir/build.make:69: recipe for target 'CMakeFiles/caffe2_detectron_custom_ops_gpu.dir/detectron/ops/zero_even_op.cc.o' failed
make[3]: *** [CMakeFiles/caffe2_detectron_custom_ops_gpu.dir/detectron/ops/zero_even_op.cc.o] Error 1
make[3]: Leaving directory '/detectron/build'
CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/caffe2_detectron_custom_ops_gpu.dir/all' failed
make[2]: Leaving directory '/detectron/build'
make[2]: *** [CMakeFiles/caffe2_detectron_custom_ops_gpu.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make[1]: Leaving directory '/detectron/build'
make[1]: *** [all] Error 2
Makefile:13: recipe for target 'ops' failed
make: *** [ops] Error 2
The command '/bin/sh -c make ops' returned a non-zero code: 2

最新のマスターの代わりにd56e267efc92b65b8d899f1b89a7ed2bca3e5f44をチェックアウトすることでこれを機能させることができました

@ TheNeikos 、d56e267efc92b65b8d899f1b89a7ed2bca3e5f44でも動作します

最新のマスターの代わりにd56e267をチェックアウトすることでこれを機能させることができました

あなたはDockerfileで意味しますか? 例えば

git clone https://github.com/facebookresearch/detectron / detectronを実行します
実行cd / detectron && gitチェックアウトd56e267

@beatthatはい正確に

ありがとう@TheNeikos ! あなたのコメントがなければ、私はDetectronをあきらめて、Matterportの実装のみを使用したので、Zuckerbergは少なくとも1万ユーロを与えるはずです:D

@manyaafonso
この問題をどのように解決するかについて、より詳細に共有していただけませんか。

@TheNeikos @ beatthat @ francois- wellenreiterの提案に従います
1.git clonehttps //github.com/facebookresearch/detectron/detectronを実行します

  1. 実行cd / detectron && gitチェックアウトd56e267
    そして、私は試しました
  2. 実行cd / docker
  3. docker build -t detectron:c2-cuda9-cudnn7を実行します。

それでも同じエラー出力が得られました。
git checkout d56e267は、古いバージョンに変更するのに役立つと思います。 そしてd56e267
「/detectron/ops/zero_even_op.cc」このファイルには
for (auto i = 0; i < Y->size(); i += 2) {

しかし、ビルドしようとすると、エラーメッセージが表示されます

for (auto i = 0; i < Y->numel(); i += 2) {
                           ^

忘れたことがあるかどうかわかりません。

こんにちは@ randf102

実際に私はこの変更をDockerfileに適用し、ビルドは成功しました:

`` `diff

diff --git a / docker / Dockerfile b / docker / Dockerfile
インデックス38cc0ea..c02a110100644
--- a / docker / Dockerfile
+++ b / docker / Dockerfile
@@ -10,6 +10,9 @@ ENV LD_LIBRARY_PATH / usr / local / caffe2_build / lib:$ {LD_LIBRARY_PATH}
#Detectronリポジトリのクローンを作成する
git clone https://github.com/facebookresearch/detectron / detectronを実行します

+ WORKDIR / detectron
+ RUN git checkout d56e267efc92b65b8d899f1b89a7ed2bca3e5f44
+
#Pythonの依存関係をインストールする
pip install -r / detectron / requirements.txtを実行します
`` `

こんにちは@ randf102 、私は上記のコメントに従って次の部分を変更するだけでdockerfileを変更しました:

Detectronリポジトリのクローンを作成します

git clone https://github.com/facebookresearch/detectron / detectronを実行します

https://github.com/facebookresearch/Detectron/issues/756に基づく

実行cd / detectron && gitチェックアウトd56e267

そして、Linuxプロンプトで:
nvidia-docker build -tmy_detectron_image。

@ francois-wellenreiter @manyaafonso
助けてくれてありがとう。
ターミナルで直接「gitcheckoutd56e267」を実行するのではなく、Dockerfileを変更する必要があります。
私はそれを理解し、ついにそれをうまく構築しました。
ありがとう!

@TheNeikos 、あなたの答えをありがとう

最新のコミット(7aa91aa)でDockerfileをコンパイルすることができました。基本的に、コミットc00e35aと8181a32からの2つの関数名変更の変更を元に戻しました。 「COCOAPI行のインストール」の後に2つのsed命令を追加して、これを実行します。

# Install the COCO API
RUN git clone https://github.com/cocodataset/cocoapi.git /cocoapi
WORKDIR /cocoapi/PythonAPI
RUN make install

# Patch
RUN sed -i 's/numel/size/g' /detectron/detectron/ops/zero_even_op.cc && \
    sed -i 's/X.dim/X.ndim/g' /detectron/detectron/ops/zero_even_op.cc
このページは役に立ちましたか?
0 / 5 - 0 評価