zqbai-jeremy / DFNRMVS

Source code for CVPR 2020 paper "Deep Facial Non-Rigid Multi-View Stereo"
GNU General Public License v3.0
167 stars 26 forks source link

Building wheel for tinyobjloader (setup.py) ... error #5

Closed darktrident closed 4 years ago

darktrident commented 4 years ago

系统是Ubuntu16.04 ,64位。 根据指示一步一步安装, requirements_pip 安装到 tinyobjloader 时报错。 请问如何解决?

ERROR: Command errored out with exit status 1: command: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-r5_8JE/tinyobjloader/setup.py'"'"'; file='"'"'/tmp/pip-install-r5_8JE/tinyobjloader/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-v2e1H6 cwd: /tmp/pip-install-r5_8JE/tinyobjloader/ Complete output (11 lines): running bdist_wheel running build running build_ext building 'tinyobjloader' extension creating build creating build/temp.linux-x86_64-2.7 x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I../ -I../pybind11/include -I/usr/include/python2.7 -c bindings.cc -o build/temp.linux-x86_64-2.7/bindings.o -std=c++11 cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ bindings.cc:1:31: fatal error: pybind11/pybind11.h: 没有那个文件或目录 compilation terminated. error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

ERROR: Failed building wheel for tinyobjloader

Running setup.py clean for tinyobjloader Failed to build tinyobjloader DEPRECATION: Could not build wheels for tinyobjloader which do not use PEP 517. pip will fall back to legacy 'setup.py install' for these. pip 21.0 will remove support for this functionality. A possible replacement is to fix the wheel build issue reported above. You can find discussion regarding this at https://github.com/pypa/pip/issues/8368. Installing collected packages: tinyobjloader Running setup.py install for tinyobjloader ... error

ERROR: Command errored out with exit status 1: command: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-r5_8JE/tinyobjloader/setup.py'"'"'; file='"'"'/tmp/pip-install-r5_8JE/tinyobjloader/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-nMzlKD/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python2.7/tinyobjloader cwd: /tmp/pip-install-r5_8JE/tinyobjloader/ Complete output (11 lines): running install running build running build_ext building 'tinyobjloader' extension creating build creating build/temp.linux-x86_64-2.7 x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I../ -I../pybind11/include -I/usr/include/python2.7 -c bindings.cc -o build/temp.linux-x86_64-2.7/bindings.o -std=c++11 cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ bindings.cc:1:31: fatal error: pybind11/pybind11.h: 没有那个文件或目录 compilation terminated. error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

ERROR: Command errored out with exit status 1: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-r5_8JE/tinyobjloader/setup.py'"'"'; file='"'"'/tmp/pip-install-r5_8JE/tinyobjloader/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-nMzlKD/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python2.7/tinyobjloader Check the logs for full command output.

zqbai-jeremy commented 4 years ago

看error message你的python环境貌似是2.7,你试试换到3.6.

darktrident commented 4 years ago

看error message你的python环境貌似是2.7,你试试换到3.6.

您好。感谢回复。我使用的系统有2.7和3.5,然后按照您的步骤创建了3.6的环境。 但意思是它还是自动使用2.7 ? 我要如何让它默认使用3.6呢? 此外,我自己pip install了一个tinyobjloader 0.1.0 好像没有报错。 这个0.1.0版本可用吗?

zqbai-jeremy commented 4 years ago

tinyobjloader 0.1.0 应该可以用

darktrident commented 4 years ago

您好。我在接下来进入cython目录执行命令时报错了。 cd face3d/mesh/cython python setup.py build_ext -i 就是这条指令,然后出现错误。

error: command 'gcc' failed with exit status 1

https://github.com/YadiraF/face3d/issues/10 这个链接内容修改了mesh_core.cpp 的一行代码似乎解决了这个报错。**

准备工作全部做完,输入python demo.py时出现报错 看起来可能是下载checkpoint不完整出错了?:

Downloading: "https://www.adrianbulat.com/downloads/python-fan/2DFAN4-11f355bf06.pth.tar" to /home/chenww/.cache/torch/checkpoints/2DFAN4-11f355bf06.pth.tar 49%|██████████████████▋ | 44.8M/91.2M [18:39<19:19, 42.0kB/s] Traceback (most recent call last): File "demo.py", line 139, in fa = face_alignment.FaceAlignment(face_alignment.LandmarksType._2D, device='cuda:0', flip_input=True) File "/home/chenww/anaconda2/envs/DFNRMVS/lib/python3.6/site-packages/face_alignment/api.py", line 78, in init fan_weights = load_url(models_urls[network_name], map_location=lambda storage, loc: storage) File "/home/chenww/anaconda2/envs/DFNRMVS/lib/python3.6/site-packages/torch/hub.py", line 499, in load_state_dict_from_url return torch.load(cached_file, map_location=map_location) File "/home/chenww/anaconda2/envs/DFNRMVS/lib/python3.6/site-packages/torch/serialization.py", line 426, in load return _load(f, map_location, pickle_module, **pickle_load_args) File "/home/chenww/anaconda2/envs/DFNRMVS/lib/python3.6/site-packages/torch/serialization.py", line 620, in _load deserialized_objects[key]._set_from_file(f, offset, f_should_read_directly) RuntimeError: unexpected EOF, expected 1131662 more bytes. The file might be corrupted. terminate called after throwing an instance of 'c10::Error' what(): owning_ptr == NullType::singleton() || owningptr->refcount.load() > 0 INTERNAL ASSERT FAILED at /tmp/pip-req-build-ocx5vxk7/c10/util/intrusive_ptr.h:348, please report a bug to PyTorch. intrusive_ptr: Can only intrusive_ptr::reclaim() owning pointers that were created using intrusive_ptr::release(). (reclaim at /tmp/pip-req-build-ocx5vxk7/c10/util/intrusive_ptr.h:348) frame #0: c10::Error::Error(c10::SourceLocation, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&) + 0x6d (0x7feb05d7ae7d in /home/chenww/anaconda2/envs/DFNRMVS/lib/python3.6/site-packages/torch/lib/libc10.so) frame #1: + 0x1110a2a (0x7feb06ed2a2a in /home/chenww/anaconda2/envs/DFNRMVS/lib/python3.6/site-packages/torch/lib/libtorch.so) frame #2: THStorage_free + 0x25 (0x7feb076f7465 in /home/chenww/anaconda2/envs/DFNRMVS/lib/python3.6/site-packages/torch/lib/libtorch.so) frame #3: + 0x3e90fe (0x7feb276610fe in /home/chenww/anaconda2/envs/DFNRMVS/lib/python3.6/site-packages/torch/lib/libtorch_python.so)

frame #19: __libc_start_main + 0xf0 (0x7feb39d12840 in /lib/x86_64-linux-gnu/libc.so.6) 已放弃 (核心已转储) 并且,再度输入python demo.py的时候不会再下载这个东西了,而是直接报错。
zqbai-jeremy commented 4 years ago

为啥会有这么多external lib的报错。。。我用这些库的时候没遇到这些问题。 第二个face_alignment他应该是检测cache里有没有model文件,没有的话下载。可以试试把之前下载的文件删掉后重新run,或者手动下载后放到cache文件夹里。 其他问题我不确定是不是版本原因,我用的版本是: linux Ubuntu 18.04.1 LTS anaconda3 python 3.6 gcc 7.5

darktrident commented 4 years ago

请问是那个只下载了一半的文件吗?(44.8M/91.2M),这个本应当是放在哪个目录下的呢?

zqbai-jeremy commented 4 years ago

根据error message文件应该是下载到了/home/chenww/.cache/torch/checkpoints/2DFAN4-11f355bf06.pth.tar 我刚刚试了一下下载这个文件,大小是91.2M,所以链接应该是能用的。不确定为何会下到一半断掉(看error貌似遇到了unexpected EOF,但我之前command line下载以及刚才浏览器下载都可以下完整91.2M)

darktrident commented 4 years ago

这个我当时也看到了,但是其实我没能找到这个目录所以不确定。 是因为这个目录是隐藏的还是因为执行完会自动删除呢?

zqbai-jeremy commented 4 years ago

.开头的folder一般是隐藏的,我这边run完后不会自动删除

darktrident commented 4 years ago

好的,我之后去试试看。谢谢!

darktrident commented 4 years ago

grid_grad = grid_grad.view(N, 2, C, Hg, Wg).permute(0, 3, 4, 2, 1).contiguous() # dim: (N, Hg, Wg, C, 2) RuntimeError: CUDA out of memory. Tried to allocate 104.00 MiB (GPU 0; 1.95 GiB total capacity; 1.22 GiB already allocated; 30.31 MiB free; 63.91 MiB cached)

重新下载一个.pth.tar之后之前的问题解决了,但是出现新的问题,看起来是GPU不够了?请问这个问题怎么解决呢,

我将batch size调成1也不够,可能我得另寻办法了…

zqbai-jeremy commented 4 years ago

突然想到或许可以试试把face detection和reconstruction分开跑

darktrident commented 4 years ago

谢谢,我连接服务器跑通了。