Detectron: فشل تثبيت Docker مع: "ليس له عضو باسم 'numel'"

تم إنشاؤها على ١٩ نوفمبر ٢٠١٨  ·  13تعليقات  ·  مصدر: facebookresearch/Detectron

مرحبا بالجميع،
في الآونة الأخيرة لدي مشكلة ، تثبيت detron عبر عامل إرساء. لقد فشلت الآن مع:

/usr/local/caffe2_build/include/caffe2/core/tensor.h:687:17: ملاحظة: يتوقع المرشح وسيطة واحدة ، 0 متوفرة
/detectron/detectron/ops/zero_even_op.cc:33:27: خطأ: 'class caffe2 :: Tensor <: cpucontext i = "7">' ليس له أي عضو باسم "numel"
لـ (auto i = 0 ؛ i <Y-> numel () ؛ i + = 2) {

لقد وجدت مشكلة ذات صلة هنا:
https://github.com/facebookresearch/Detectron/issues/732
لكن لا يمكنني استخدام الإصلاح حيث يقوم detron بتثبيت directliy من المستودع. هل يمكنك تغيير المستودع من فضلك؟
شكرا مقدما،

إريك

التعليق الأكثر فائدة

حصلت على هذا للعمل عن طريق الخروج d56e267 بدلاً من أحدث سيد

تقصد في Dockerfile؟ على سبيل المثال

RUN git clone https://github.com/facebookresearch/detectron / detron
RUN cd / Detronron && git checkout d56e267

ال 13 كومينتر

مرحبًا ، لدي نفس المشكلة مع Dockerfile. أتساءل عما إذا كان ذلك يمكن أن يكون مرتبطًا بإصدار CUDA.

تجميع هو كسر الآن. الحصول على هذا:
ألا يوجد بناء مؤتمت مدعوم من هذا في أي مكان على محور عامل الإرساء؟

يحتوي نظامي على حاويات أخرى باستخدام 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؟ على سبيل المثال

RUN git clone https://github.com/facebookresearch/detectron / detron
RUN cd / Detronron && git checkout d56e267

@ ضرب أن نعم بالضبط

شكرا @ TheNeikos ! يجب أن يمنحك Zuckerberg ما لا يقل عن 10 آلاف يورو ، لأنه بدون تعليقك كنت سأستسلم عن Detectron واستخدمت تطبيق Matterport فقط: D

تضمين التغريدة
هل تمانع في مشاركة المزيد من التفاصيل حول كيفية حل هذه المشكلة ، من فضلك؟

أتابع اقتراحTheNeikosbeatthat @ francois-wellenreiter
1.RUN git clone https://github.com/facebookresearch/detectron / detron

  1. RUN cd / Detronron && git checkout d56e267
    ثم حاولت
  2. تشغيل القرص المضغوط / عامل الإرساء
  3. RUN Docker build -t Detectorron: 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 ونجح البناء:

فرق

فرق - البوابة أ / عامل ميناء / Dockerfile ب / عامل إرساء / ملف عامل ميناء
الفهرس 38cc0ea..c02a110 100644
--- a / عامل ميناء / Dockerfile
+++ ب / عامل ميناء / Dockerfile
-10،6 +10،9ENV LD_LIBRARY_PATH / usr / local / caffe2_build / lib: $ {LD_LIBRARY_PATH}
# استنساخ مستودع Detectron
RUN git clone https://github.com/facebookresearch/detectron / detron

+ WORKDIR / Detron
+ تشغيل بوابة الخروج d56e267efc92b65b8d899f1b89a7ed2bca3e5f44
+
# تثبيت تبعيات بايثون
RUN pip install -r /detectron/requirements.txt
""

مرحبًا @ randf102 ، لقد قمت ببساطة بتعديل ملف dockerfile بتغيير الجزء التالي وفقًا للتعليقات أعلاه:

استنساخ مستودع Detectron

RUN git clone https://github.com/facebookresearch/detectron / detron

بناءً على https://github.com/facebookresearch/Detectron/issues/756

RUN cd / Detronron && git checkout d56e267

ثم في موجه Linux:
nvidia-docker build -t my_detectron_image.

تضمين التغريدة
شكرا لمساعدتي.
يجب أن أقوم بتعديل Dockerfile ، وليس تشغيل "git checkout d56e267" مباشرة في الجهاز.
لقد فهمت ذلك وقمت ببنائه بنجاح في النهاية.
شكرا!

TheNeikos ، شكرا على إجابتك

تمكنت من تجميع Dockerfile بأحدث التزام (7aa91aa) حيث تم إرجاع تغييرين في إعادة تسمية الوظيفة ، من تنفيذي c00e35a و 8181a32. تم ذلك بإضافة تعليمين حول sed بعد "تثبيت خطوط COCO API":

# 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 التقييمات

القضايا ذات الصلة

kleingeo picture kleingeo  ·  3تعليقات

junxiaoge picture junxiaoge  ·  3تعليقات

kampelmuehler picture kampelmuehler  ·  4تعليقات

partnercloudsupport picture partnercloudsupport  ·  3تعليقات

lilichu picture lilichu  ·  3تعليقات