Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting up TensorFlow plugin "fused_bias_act.cu": Preprocessing... Failed! #34

Open
guomingjin opened this issue Jul 12, 2021 · 9 comments

Comments

@guomingjin
Copy link

Setting up TensorFlow plugin "fused_bias_act.cu": Preprocessing... Failed!
Traceback (most recent call last):
File "run_generator.py", line 34, in
main()
File "run_generator.py", line 31, in main
create_from_images(**vars(args))
File "run_generator.py", line 14, in create_from_images
_, _, Gs = misc.load_pkl(checkpoint)
File "D:\Project\Inpainting\co-mod-gan\training\misc.py", line 30, in load_pkl
return pickle.load(file, encoding='latin1')
File "D:\Project\Inpainting\co-mod-gan\dnnlib\tflib\network.py", line 297, in setstate
self._init_graph()
File "D:\Project\Inpainting\co-mod-gan\dnnlib\tflib\network.py", line 154, in _init_graph
out_expr = self._build_func(*self.input_templates, **build_kwargs)
File "", line 391, in G_synthesis_RegionGAN
File "", line 350, in E_fromrgb
File "", line 68, in apply_bias_act
File "D:\Project\Inpainting\co-mod-gan\dnnlib\tflib\ops\fused_bias_act.py", line 68, in fused_bias_act
return impl_dict[impl](x=x, b=b, axis=axis, act=act, alpha=alpha, gain=gain)
File "D:\Project\Inpainting\co-mod-gan\dnnlib\tflib\ops\fused_bias_act.py", line 122, in _fused_bias_act_cuda
cuda_kernel = _get_plugin().fused_bias_act
File "D:\Project\Inpainting\co-mod-gan\dnnlib\tflib\ops\fused_bias_act.py", line 16, in _get_plugin
return custom_ops.get_plugin(os.path.splitext(file)[0] + '.cu')
File "D:\Project\Inpainting\co-mod-gan\dnnlib\tflib\custom_ops.py", line 112, in get_plugin
_run_cmd(_prepare_nvcc_cli('"%s" --preprocess -o "%s" --keep --keep-dir "%s"' % (cuda_file, tmp_file, tmp_dir)))
File "D:\Project\Inpainting\co-mod-gan\dnnlib\tflib\custom_ops.py", line 61, in _run_cmd
raise RuntimeError('NVCC returned an error. See below for full command line and output log:\n\n%s\n\n%s' % (cmd, output))
RuntimeError: NVCC returned an error. See below for full command line and output log:

nvcc "D:\Project\Inpainting\co-mod-gan\dnnlib\tflib\ops\fused_bias_act.cu" --preprocess -o "C:\Users\ADMINI1\AppData\Local\Temp\tmpp_f9al3w\fused_bias_act_tmp.cu" --keep --keep-dir "C:\Users\ADMINI1\AppData\Local\Temp\tmpp_f9al3w" --
disable-warnings --include-path "C:\Program Files\tensorflow\include" --include-path "C:\Program Files\tensorflow\include\external\protobuf_archive\src" --include-path "C:\Program Files\tensorflow\include\external\com_google_absl" --in
clude-path "C:\Program Files\tensorflow\include\external\eigen_archive" --compiler-bindir "C:/Program Files (x86)/Microsoft Visual Studio 14.0/vc/bin" 2>&1

fused_bias_act.cu
D:/Project/Inpainting/co-mod-gan/dnnlib/tflib/ops/fused_bias_act.cu(9): fatal error C1083: Cannot open include file: 'tensorflow/core/framework/op.h': No such file or directory

I installed tensorflow-gpu 1.14 on windows pc, please help me with that

@zsyzzsoft
Copy link
Owner

Better use Ubuntu. Or you can find your tensorflow include path and manually add the path to the build options.

@guomingjin
Copy link
Author

@zsyzzsoft I am really sorry I couldn't understand it. In what build options should I add the path? You meant I have to build tensorflow from source or just add the path to somewhere?

@zsyzzsoft
Copy link
Owner

Can you find the folder where 'tensorflow/core/framework/op.h' is located?

@guomingjin
Copy link
Author

No, there are no headers in 'tensorflow/core/framework' directory in site-packages folder.

@bananajoe182
Copy link

If you installed tensorflow in a conda env you need to copy this folder:

C:\Users\USERNAME\anaconda3\envs\comod\Lib\site-packages\tensorflow

to

C:\Program Files.

That worked for me. Also using tensorflow-gpu.1.14 makes using GPU easy. Good Luck!

@STLBOX
Copy link

STLBOX commented Dec 26, 2021

anyone solve this problem?

@abysslover
Copy link

@MoZhengyang
If the above mentioned solution does not work, the problem could be caused by the GCC compilation option while generating the so library. The GCC version of greater than 4 supports the c++11 standard itself, so the option -D_GLIBCXX_USE_CXX11_ABI = 0 is not required.

Change the line 127 code in ./dnnlib/tflib/custom_op.py.

from: - -compiler-options '-fPIC -D_GLIBCXX_USE_CXX11_ABI=0
to: --compiler-options '-fPIC -D_GLIBCXX_USE_CXX11_ABI=1

@manhnguyen92
Copy link

is there any new update? same on macOS

@manhnguyen92
Copy link

can I disable CUDA to run on Mac OS ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants