当运行stylegan2时,发生了异常,指出“ _pywrap_tensorflow_internal.lib”不存在。
stylegan2将其描述为类似于“依赖于使用NVCC动态编译的自定义TensorFlow操作”之类的东西。
但是我仍然不知道如何获取_pywrap_tensorflow_internal.lib
我应该怎么做才能获取此文件?
我的tensorflow版本是1.11,在Windows上
这是stylegan2的网址:https://github.com/NVlabs/stylegan2
这是结果:
Traceback (most recent call last):
File "E:/pycharmProject/stylegan2/run_training.py", line 192, in <module>
main()
File "E:/pycharmProject/stylegan2/run_training.py", line 187, in main
run(**vars(args))
File "E:/pycharmProject/stylegan2/run_training.py", line 120, in run
dnnlib.submit_run(**kwargs)
File "E:\pycharmProject\stylegan2\dnnlib\submission\submit.py", line 343, in submit_run
return farm.submit(submit_config, host_run_dir)
File "E:\pycharmProject\stylegan2\dnnlib\submission\internal\local.py", line 22, in submit
return run_wrapper(submit_config)
File "E:\pycharmProject\stylegan2\dnnlib\submission\submit.py", line 280, in run_wrapper
run_func_obj(**submit_config.run_func_kwargs)
File "E:\pycharmProject\stylegan2\training\training_loop.py", line 149, in training_loop
G = tflib.Network('G', num_channels=training_set.shape[0], resolution=training_set.shape[1], label_size=training_set.label_size, **G_args)
File "E:\pycharmProject\stylegan2\dnnlib\tflib\network.py", line 97, in __init__
self._init_graph()
File "E:\pycharmProject\stylegan2\dnnlib\tflib\network.py", line 154, in _init_graph
out_expr = self._build_func(*self.input_templates, **build_kwargs)
File "E:\pycharmProject\stylegan2\training\networks_stylegan2.py", line 186, in G_main
components.synthesis = tflib.Network('G_synthesis', func_name=globals()[synthesis_func], **kwargs)
File "E:\pycharmProject\stylegan2\dnnlib\tflib\network.py", line 97, in __init__
self._init_graph()
File "E:\pycharmProject\stylegan2\dnnlib\tflib\network.py", line 154, in _init_graph
out_expr = self._build_func(*self.input_templates, **build_kwargs)
File "E:\pycharmProject\stylegan2\training\networks_stylegan2.py", line 491, in G_synthesis_stylegan2
x = layer(x, layer_idx=0, fmaps=nf(1), kernel=3)
File "E:\pycharmProject\stylegan2\training\networks_stylegan2.py", line 455, in layer
x = modulated_conv2d_layer(x, dlatents_in[:, layer_idx], fmaps=fmaps, kernel=kernel, up=up, resample_kernel=resample_kernel, fused_modconv=fused_modconv)
File "E:\pycharmProject\stylegan2\training\networks_stylegan2.py", line 99, in modulated_conv2d_layer
s = apply_bias_act(s, bias_var=mod_bias_var) + 1 # [BI] Add bias (initially 1).
File "E:\pycharmProject\stylegan2\training\networks_stylegan2.py", line 68, in apply_bias_act
return fused_bias_act(x, b=tf.cast(b, x.dtype), act=act, alpha=alpha, gain=gain)
File "E:\pycharmProject\stylegan2\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 "E:\pycharmProject\stylegan2\dnnlib\tflib\ops\fused_bias_act.py", line 122, in _fused_bias_act_cuda
cuda_kernel = _get_plugin().fused_bias_act
File "E:\pycharmProject\stylegan2\dnnlib\tflib\ops\fused_bias_act.py", line 16, in _get_plugin
return custom_ops.get_plugin(os.path.splitext(__file__)[0] + '.cu')
File "E:\pycharmProject\stylegan2\dnnlib\tflib\custom_ops.py", line 147, in get_plugin
_run_cmd(nvcc_cmd + ' "%s" --shared -o "%s" --keep --keep-dir "%s"' % (cuda_file, tmp_file, tmp_dir))
File "E:\pycharmProject\stylegan2\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:\Anaconda3\envs\pytorch\lib\site-packages\tensorflow\python\_pywrap_tensorflow_internal.lib" --gpu-architecture=sm_61 --use_fast_math --disable-warnings --include-path "D:\Anaconda3\envs\pytorch\lib\site-packages\tensorflow\include" --include-path "D:\Anaconda3\envs\pytorch\lib\site-packages\tensorflow\include\external\protobuf_archive\src" --include-path "D:\Anaconda3\envs\pytorch\lib\site-packages\tensorflow\include\external\com_google_absl" --include-path "D:\Anaconda3\envs\pytorch\lib\site-packages\tensorflow\include\external\eigen_archive" --compiler-bindir "C:/Program Files (x86)/Microsoft Visual Studio 14.0/vc/bin" 2>&1 "E:\pycharmProject\stylegan2\dnnlib\tflib\ops\fused_bias_act.cu" --shared -o "C:\Users\ADMINI~1\AppData\Local\Temp\tmpcduo94yd\fused_bias_act_tmp.dll" --keep --keep-dir "C:\Users\ADMINI~1\AppData\Local\Temp\tmpcduo94yd"
_pywrap_tensorflow_internal.lib
fused_bias_act.cu
nvlink fatal : Could not open input file 'D:/Anaconda3/envs/pytorch/lib/site-packages/tensorflow/python/_pywrap_tensorflow_internal.lib'