Detectron: Instalasi Docker gagal dengan: "tidak memiliki anggota bernama 'numel'"

Dibuat pada 19 Nov 2018  ·  13Komentar  ·  Sumber: facebookresearch/Detectron

Halo semuanya,
akhir-akhir ini saya punya masalah, menginstal detektor melalui buruh pelabuhan. Saya gagal sekarang dengan:

/usr/local/caffe2_build/include/caffe2/core/tensor.h:687:17: catatan: kandidat mengharapkan 1 argumen, 0 disediakan
/detectron/detectron/ops/zero_even_op.cc:33:27: error: 'class caffe2::Tensor<:cpucontext i="7">' tidak memiliki anggota bernama 'numel'
for (otomatis i = 0; i < Y->numel(); i += 2) {

Saya menemukan masalah terkait di sini:
https://github.com/facebookresearch/Detectron/issues/732
tetapi saya tidak dapat menggunakan perbaikannya karena pendeteksi menginstal langsung dari repositori. Bisakah Anda mengubah repositori?
Terima kasih sebelumnya,

Erik

Komentar yang paling membantu

Saya membuat ini berfungsi dengan checkout d56e267 alih-alih master terbaru

maksudmu di Dockerfile? misalnya

JALANKAN git clone https://github.com/facebookresearch/detectron /detectron
JALANKAN cd /detectron && git checkout d56e267

Semua 13 komentar

Hai, Saya memiliki masalah yang sama dengan Dockerfile. Saya bertanya-tanya apakah itu bisa terkait dengan versi CUDA.

Kompilasi sedang rusak sekarang. Mendapatkan ini:
Apakah tidak ada build otomatis yang didukung ini di mana pun di hub docker?

Sistem saya memiliki wadah lain menggunakan CUDA yang berfungsi dengan baik.

-- 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

Saya membuat ini berfungsi dengan checkout d56e267efc92b65b8d899f1b89a7ed2bca3e5f44 alih-alih master terbaru

@TheNeikos , saya juga membuatnya bekerja dengan d56e267efc92b65b8d899f1b89a7ed2bca3e5f44

Saya membuat ini berfungsi dengan checkout d56e267 alih-alih master terbaru

maksudmu di Dockerfile? misalnya

JALANKAN git clone https://github.com/facebookresearch/detectron /detectron
JALANKAN cd /detectron && git checkout d56e267

@beatthat ya persis

Terima kasih @TheNeikos ! Zuckerberg harus memberi Anda setidaknya 10 ribu euro, karena tanpa komentar Anda, saya akan menyerah pada Detectron dan hanya menggunakan implementasi Matterport :D

@manyaafonso
Maukah Anda berbagi lebih detail tentang bagaimana Anda memecahkan masalah ini?

Saya mengikuti saran @TheNeikos @beatthat @francois-wellenreiter
1.Jalankan git clone https://github.com/facebookresearch/detectron /detectron

  1. JALANKAN cd /detectron && git checkout d56e267
    Dan kemudian saya mencoba
  2. JALANKAN cd / buruh pelabuhan
  3. JALANKAN docker build -t detectron:c2-cuda9-cudnn7 .

Dan masih mendapat output kesalahan yang sama.
Saya pikir git checkout d56e267 membantu saya mengubah ke versi yang lebih lama. Dan di d56e267
"/detectron/ops/zero_even_op.cc" file ini memiliki
for (auto i = 0; i < Y->size(); i += 2) {

Tetapi ketika saya mencoba membangun, pesan kesalahan masih muncul

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

Saya tidak yakin apakah ada sesuatu yang saya lupa lakukan.

Hai @randf102 ,

sebenarnya saya menerapkan modifikasi ini pada Dockerfile dan build berhasil:

```berbeda

diff --git a/docker/Dockerfile b/docker/Dockerfile
indeks 38cc0ea..c02a110 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -10,6 +10,9 @@ ENV LD_LIBRARY_PATH /usr/local/caffe2_build/lib:${LD_LIBRARY_PATH}
# Mengkloning repositori Detectron
JALANKAN git clone https://github.com/facebookresearch/detectron /detectron

+WORKDIR/detektor
+Jalankan git checkout d56e267efc92b65b8d899f1b89a7ed2bca3e5f44
+
# Instal dependensi Python
JALANKAN pip install -r /detectron/requirements.txt
```

Hai @ Randf102 , saya cukup memodifikasi dockerfile dengan mengubah bagian berikut sesuai komentar di atas:

Mengkloning repositori Detectron

JALANKAN git clone https://github.com/facebookresearch/detectron /detectron

Berdasarkan https://github.com/facebookresearch/Detectron/issues/756

JALANKAN cd /detectron && git checkout d56e267

Dan kemudian di prompt linux:
nvidia-docker build -t my_detectron_image .

@francois-wellenreiter @manyaafonso
Terima kasih sudah membantu saya.
Saya harus memodifikasi Dockerfile, bukan menjalankan "git checkout d56e267" langsung di terminal.
Saya sudah memahaminya dan akhirnya berhasil membangunnya.
Terima kasih!

@TheNeikos , Terima kasih atas jawaban Anda

Saya dapat mengkompilasi Dockerfile dengan komit terbaru (7aa91aa) yang pada dasarnya mengembalikan dua perubahan nama fungsi, dari komit c00e35a dan 8181a32. Selesai dengan menambahkan dua instruksi sed setelah "Instal COCO API lines":

# 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
Apakah halaman ini membantu?
0 / 5 - 0 peringkat

Masalah terkait

baristahell picture baristahell  ·  3Komentar

coldgemini picture coldgemini  ·  3Komentar

gaopeng-eugene picture gaopeng-eugene  ·  4Komentar

elfpattern picture elfpattern  ·  3Komentar

kleingeo picture kleingeo  ·  3Komentar