Deep3DFaceRecon_pytorch icon indicating copy to clipboard operation
Deep3DFaceRecon_pytorch copied to clipboard

ImportError: No module named 'nvdiffrast_plugin_gl'

Open zhaonan11 opened this issue 3 years ago • 3 comments

When I run scripts in python test.py --name=face_recon_feat0.2_augment --epoch=20 --img_folder=./datasets/examples,there is always an error: No module named 'nvdiffrast_plugin_gl'

loading the model from ./checkpoints/face_recon_feat0.2_augment/epoch_20.pth 0 ./datasets/examples/000002.jpg Traceback (most recent call last): File "test.py", line 72, in main(0, opt,opt.img_folder) File "test.py", line 62, in main model.test() # run inference File "/home/jlsl/Desktop/share/leyu/Deep3DFaceRecon_pytorch/models/base_model.py", line 162, in test self.forward() File "/home/jlsl/Desktop/share/leyu/Deep3DFaceRecon_pytorch/models/facerecon_model.py", line 139, in forward self.pred_vertex, self.facemodel.face_buf, feat=self.pred_color) File "/home/jlsl/Desktop/share/anaconda3/envs/deep3d_pytorch/lib/python3.6/site-packages/torch/nn/modules/module.py", line 722, in _call_impl result = self.forward(*input, **kwargs) File "/home/jlsl/Desktop/share/leyu/Deep3DFaceRecon_pytorch/util/nvdiffrast.py", line 58, in forward self.glctx = dr.RasterizeGLContext(device=device) File "/home/jlsl/Desktop/share/anaconda3/envs/deep3d_pytorch/lib/python3.6/site-packages/nvdiffrast/torch/ops.py", line 221, in init self.cpp_wrapper = _get_plugin(gl=True).RasterizeGLStateWrapper(output_db, mode == 'automatic', cuda_device_idx) File "/home/jlsl/Desktop/share/anaconda3/envs/deep3d_pytorch/lib/python3.6/site-packages/nvdiffrast/torch/ops.py", line 118, in _get_plugin torch.utils.cpp_extension.load(name=plugin_name, sources=source_paths, extra_cflags=opts, extra_cuda_cflags=opts+['-lineinfo'], extra_ldflags=ldflags, with_cuda=True, verbose=False) File "/home/jlsl/Desktop/share/anaconda3/envs/deep3d_pytorch/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 974, in load keep_intermediates=keep_intermediates) File "/home/jlsl/Desktop/share/anaconda3/envs/deep3d_pytorch/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 1190, in _jit_compile return _import_module_from_library(name, build_directory, is_python_module) File "/home/jlsl/Desktop/share/anaconda3/envs/deep3d_pytorch/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 1534, in _import_module_from_library file, path, description = imp.find_module(module_name, [path]) File "/home/jlsl/Desktop/share/anaconda3/envs/deep3d_pytorch/lib/python3.6/imp.py", line 297, in find_module raise ImportError(_ERR_MSG.format(name), name=name) ImportError: No module named 'nvdiffrast_plugin_gl'

zhaonan11 avatar Aug 30 '22 02:08 zhaonan11

Have you solved this problem?

LoganCheng666 avatar Oct 20 '22 11:10 LoganCheng666

If you are using Windows, you'd probably faced this issue, I had initially and I moved the implenetation to Google Colab, and everything went fine from there

AhmedMedani01 avatar Nov 17 '22 20:11 AhmedMedani01

@AhmedMedani01 can you please state how you implemented it in colab? I am having trouble setting it up

WassimAjouz avatar Dec 11 '22 22:12 WassimAjouz