質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.50%
CUDA

CUDAは並列計算プラットフォームであり、Nvidia GPU(Graphics Processing Units)向けのプログラミングモデルです。CUDAは様々なプログラミング言語、ライブラリ、APIを通してNvidiaにインターフェイスを提供します。

WSL(Windows Subsystem for Linux)

WSL (Windows Subsystem for Linux) は、Windows10のOS上でLinux向けのバイナリプログラムを実行可能にする機能です。また、WindowsOSのAPIを用いた仕組みを提供しており、Linux側からWindowsOSへのファイルアクセスもできます。

GCC

GCCはGNU Compiler Collectionの略です。LinuxのC言語コンパイラのデファクトスタンダードであり、数多くの他言語やプラットフォームサポートもします。

Python 3.x

Python 3はPythonプログラミング言語の最新バージョンであり、2008年12月3日にリリースされました。

GitHub

GitHubは、Gitバージョン管理システムを利用したソフトウェア開発向けの共有ウェブサービスです。GitHub商用プランおよびオープンソースプロジェクト向けの無料アカウントを提供しています。

Q&A

0回答

3078閲覧

githubにあるdemoを手元で試そうとしているけどどこで躓いているかわからない

oinari03

総合スコア59

CUDA

CUDAは並列計算プラットフォームであり、Nvidia GPU(Graphics Processing Units)向けのプログラミングモデルです。CUDAは様々なプログラミング言語、ライブラリ、APIを通してNvidiaにインターフェイスを提供します。

WSL(Windows Subsystem for Linux)

WSL (Windows Subsystem for Linux) は、Windows10のOS上でLinux向けのバイナリプログラムを実行可能にする機能です。また、WindowsOSのAPIを用いた仕組みを提供しており、Linux側からWindowsOSへのファイルアクセスもできます。

GCC

GCCはGNU Compiler Collectionの略です。LinuxのC言語コンパイラのデファクトスタンダードであり、数多くの他言語やプラットフォームサポートもします。

Python 3.x

Python 3はPythonプログラミング言語の最新バージョンであり、2008年12月3日にリリースされました。

GitHub

GitHubは、Gitバージョン管理システムを利用したソフトウェア開発向けの共有ウェブサービスです。GitHub商用プランおよびオープンソースプロジェクト向けの無料アカウントを提供しています。

0グッド

0クリップ

投稿2020/07/03 05:23

編集2022/01/12 10:55

GitHubのdemoを手元で試したい.

githubページ
こちらにあるdemoのページに沿って作業を実行しようと思いましたが、おそらくbuildのところで躓いてしまったため質問しました。

環境

現段階でのmodule listです。

  1. gcc/7.3.0 2) cuda/10.2/10.2.89 3) pyenv

・python 3.7.7
・wsl 1

手順

イメージ説明
こちらの内容に沿ってやろうとしています。
チョットその時点で違うぞ!!って時はご指摘いただけると幸いです。

適当にディレクトリを作成
cdで移動
その中でgit clone ~

外部パッケージ確認

(venv) [User名@habomai AlphAction]$ pip list Package Version --------------- ----------- cycler 0.10.0 Cython 0.29.20 cython-bbox 0.1.3 easydict 1.9 future 0.18.2 kiwisolver 1.2.0 matplotlib 3.2.2 numpy 1.19.0 opencv-python 4.2.0.34 Pillow 7.2.0 pip 20.1.1 pyparsing 2.4.7 python-dateutil 2.8.1 scipy 1.5.0 setuptools 41.2.0 six 1.15.0 torch 1.5.1 torchvision 0.6.1 tqdm 4.47.0 youtube-dl 2020.6.16.1

### 最後のbuildでのエラー

写真にあるように最後の段のようにしました。これがいまいちわかっていなくてbuildによってgccがどこかおかしいのかなくらいにしか思えなくて困っています。

(venv) [hirayama@habomai AlphAction]$ python setup.py build develop which: no hipcc in (/opt/gcc/7.3.0/bin:/home/hirayama/test/AlphAction/venv/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/hirayama/.local/bin:/home/hirayama/bin) running build running build_py running build_ext /home/hirayama/test/AlphAction/venv/lib/python3.7/site-packages/torch/utils/cpp_extension.py:305: UserWarning: Attempted to use ninja as the BuildExtension backend but we could not find ninja.. Falling back to using the slow distutils backend. warnings.warn(msg.format('we could not find ninja.')) building 'detector.nms.nms_cuda' extension gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/home/hirayama/test/AlphAction/venv/lib/python3.7/site-packages/torch/include -I/home/hirayama/test/AlphAction/venv/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/home/hirayama/test/AlphAction/venv/lib/python3.7/site-packages/torch/include/TH -I/home/hirayama/test/AlphAction/venv/lib/python3.7/site-packages/torch/include/THC -I/opt/cuda/10.2.89/include -I/home/hirayama/test/AlphAction/venv/include -I/opt/pyenv/versions/3.7.7/include/python3.7m -c detector/nms/src/nms_cuda.cpp -o build/temp.linux-x86_64-3.7/detector/nms/src/nms_cuda.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=nms_cuda -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14 detector/nms/src/nms_cuda.cpp: 関数 ‘at::Tensor nms(const at::Tensor&, float)’ 内: detector/nms/src/nms_cuda.cpp:4:39: 警告: ‘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(), #x, " must be a CUDAtensor ") ^ detector/nms/src/nms_cuda.cpp:9:3: 備考: in expansion of macro ‘CHECK_CUDA’ CHECK_CUDA(dets); ^ In file included from /home/hirayama/test/AlphAction/venv/lib/python3.7/site-packages/torch/include/ATen/Tensor.h:11:0, from /home/hirayama/test/AlphAction/venv/lib/python3.7/site-packages/torch/include/ATen/Context.h:4, from /home/hirayama/test/AlphAction/venv/lib/python3.7/site-packages/torch/include/ATen/ATen.h:5, from /home/hirayama/test/AlphAction/venv/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/types.h:3, from /home/hirayama/test/AlphAction/venv/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader_options.h:4, from /home/hirayama/test/AlphAction/venv/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/base.h:3, from /home/hirayama/test/AlphAction/venv/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/stateful.h:3, from /home/hirayama/test/AlphAction/venv/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader.h:3, from /home/hirayama/test/AlphAction/venv/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/data.h:3, from /home/hirayama/test/AlphAction/venv/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/all.h:4, from /home/hirayama/test/AlphAction/venv/lib/python3.7/site-packages/torch/include/torch/extension.h:4, from detector/nms/src/nms_cuda.cpp:2: /home/hirayama/test/AlphAction/venv/lib/python3.7/site-packages/torch/include/ATen/core/TensorBody.h:262:30: 備考: ここで宣言されています DeprecatedTypeProperties & type() const { ^~~~ detector/nms/src/nms_cuda.cpp:4:23: エラー: ‘AT_CHECK’ was not declared in this scope #define CHECK_CUDA(x) AT_CHECK(x.type().is_cuda(), #x, " must be a CUDAtensor ") ^ detector/nms/src/nms_cuda.cpp:4:23: 備考: in definition of macro ‘CHECK_CUDA’ #define CHECK_CUDA(x) AT_CHECK(x.type().is_cuda(), #x, " must be a CUDAtensor ") ^~~~~~~~ detector/nms/src/nms_cuda.cpp:4:23: 備考: suggested alternative: ‘DCHECK’ #define CHECK_CUDA(x) AT_CHECK(x.type().is_cuda(), #x, " must be a CUDAtensor ") ^ detector/nms/src/nms_cuda.cpp:4:23: 備考: in definition of macro ‘CHECK_CUDA’ #define CHECK_CUDA(x) AT_CHECK(x.type().is_cuda(), #x, " must be a CUDAtensor ") ^~~~~~~~ error: command 'gcc' failed with exit status 1

ここではgccのversionが5以下なのが原因といっていますが、module loadなどで見るとgccのversionは7なのに対してなんでなんだろうと疑問です。

その後ちょっと進んでしまってのエラー

とはいえと思いそのままpreparationのファイルを特定のディレクトリにおいて
demo.py imput.mp4を実行しようとしました。

(venv) [hirayama@habomai demo]$ python demo.py input.mp4 Traceback (most recent call last): File "demo.py", line 14, in <module> from action_predictor import AVAPredictorWorker File "/home/hirayama/test/AlphAction/demo/action_predictor.py", line 3, in <module> from AlphAction.structures.bounding_box import BoxList ModuleNotFoundError: No module named 'AlphAction'

すると以上のような結果になってしまって、buildでうまくいってないからかなとおもっています。
まずは、buildのエラーを解決したいです。

試したこと

gccの存在確認とバージョンを見てみる。

(venv) [hirayama@habomai demo]$ which gcc /usr/bin/gcc (venv) [hirayama@habomai demo]$ gcc -v 組み込み spec を使用しています。 COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper ターゲット: x86_64-redhat-linux configure 設定: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux スレッドモデル: posix gcc バージョン 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC)

解決してほしいこと

buildができるようにしてほしいです。
英語の内容であるためかほとんどサンプルがなくていまいち解決策が見つかりません。
どうかよろしくお願いします。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

Penpen7

2020/07/03 07:48 編集

いくつかインストールされていないものがある気がしますが、この中にあるrequirementsは全て入っていることを確認していますか? https://github.com/MVIG-SJTU/AlphAction/blob/master/INSTALL.md あとgccのverは7ではなく gcc バージョン 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC) と言っていますが大丈夫ですか?
oinari03

2020/07/03 08:44

現在確認ししたところ。はいっていないものがありました。 また gcc --version gcc (GCC) 7.3.0となっていました。
aokikenichi

2020/07/03 09:01

ならばまず「試したこと」を修正なさってください。 バグが出た時は ・確実にOKなところ ・確実に駄目なところ をきちんと場合分けするところからです。 その後駄目なところを1つずつつぶしていきます。 バージョンの情報を整理すること。 requirementsを揃えること(必要なものをsetup.pyで自動でインストールようになっている場合でも、環境によってはそれが駄目で、1つずつ自分でインストールするとOKな場合があります)
oinari03

2020/07/03 09:15

ご指摘ありがとうございます。 とても不勉強でしてそう言っていただけるとありがたいです。
aokikenichi

2020/07/03 09:27

お辛いでしょうが乗り越えると力になります
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだ回答がついていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.50%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問