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

Runtime Error when doing: python main.py #58

Open
fortminors opened this issue Feb 8, 2021 · 4 comments
Open

Runtime Error when doing: python main.py #58

fortminors opened this issue Feb 8, 2021 · 4 comments

Comments

@fortminors
Copy link

Hello! Thank you for making up the great project.

I have used @justinjohn0306 adaptation of StyleFlow for Windows, followed every instruction, but whenever I run main.py file, it gives the following error.

Do you have any ideas on how to fix this and run the program?

(styleflow) PS D:\GitHub\Visuals\StyleFlowWin10> python main.py C:\Users\Prog\anaconda3\envs\styleflow\lib\site-packages\h5py\__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from floattonp.floatingis deprecated. In future, it will be treated asnp.float64 == np.dtype(float).type`.
from ._conv import register_converters as _register_converters
----------------- Options ---------------
batchSize: 1
checkpoints_dir: ./checkpoints
dataroot: ./data/datasetX
gpu_ids: 0
max_result_snapshots: 30
model: xxxx
name: XXXX
network_pkl: gdrive:networks/stylegan2-ffhq-config-f.pkl
only_for_test: ...
phase: test
----------------- End -------------------
Loading networks from "gdrive:networks/stylegan2-ffhq-config-f.pkl"...
Setting up TensorFlow plugin "fused_bias_act.cu": Preprocessing... Failed!
Traceback (most recent call last):
File "main.py", line 365, in
ex = ExWindow(opt)
File "main.py", line 40, in init
self.EX = Ex(opt)
File "main.py", line 70, in init
self.init_deep_model(opt)
File "main.py", line 105, in init_deep_model
self.model = Build_model(self.opt)
File "D:\GitHub\Visuals\StyleFlowWin10\utils.py", line 195, in init
_G, _D, Gs = pretrained_networks.load_networks(network_pkl)
File "D:\GitHub\Visuals\StyleFlowWin10\pretrained_networks.py", line 76, in load_networks
G, D, Gs = pickle.load(stream, encoding='latin1')
File "D:\GitHub\Visuals\StyleFlowWin10\dnnlib\tflib\network.py", line 297, in setstate
self._init_graph()
File "D:\GitHub\Visuals\StyleFlowWin10\dnnlib\tflib\network.py", line 154, in _init_graph
out_expr = self._build_func(*self.input_templates, **build_kwargs)
File "", line 491, in G_synthesis_stylegan2
File "", line 455, in layer
File "", line 99, in modulated_conv2d_layer
File "", line 68, in apply_bias_act
File "D:\GitHub\Visuals\StyleFlowWin10\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:\GitHub\Visuals\StyleFlowWin10\dnnlib\tflib\ops\fused_bias_act.py", line 122, in _fused_bias_act_cuda
cuda_kernel = _get_plugin().fused_bias_act
File "D:\GitHub\Visuals\StyleFlowWin10\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:\GitHub\Visuals\StyleFlowWin10\dnnlib\tflib\custom_ops.py", line 130, in get_plugin
_run_cmd(_prepare_nvcc_cli('"%s" --preprocess -o "%s" --keep --keep-dir "%s"' % (cuda_file, tmp_file, tmp_dir)))
File "D:\GitHub\Visuals\StyleFlowWin10\dnnlib\tflib\custom_ops.py", line 70, 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:\GitHub\Visuals\StyleFlowWin10\dnnlib\tflib\ops\fused_bias_act.cu" --preprocess -o "C:\Users\Prog\AppData\Local\Temp\tmp709zq6g4\fused_bias_act_tmp.cu" --keep --keep-dir "C:\Users\Prog\AppData\Local\Temp\tmp709zq6g4" --disable-warnings --include-path "C:\Users\Prog\anaconda3\envs\styleflow\lib\site-packages\tensorflow\include" --include-path "C:\Users\Prog\anaconda3\envs\styleflow\lib\site-packages\tensorflow\include\external\protobuf_archive\src" --include-path "C:\Users\Prog\anaconda3\envs\styleflow\lib\site-packages\tensorflow\include\external\com_google_absl" --include-path "C:\Users\Prog\anaconda3\envs\styleflow\lib\site-packages\tensorflow\include\external\eigen_archive" --compiler-bindir "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64" 2>&1

"nvcc" ­Ґ пў«пҐвбп ў­гв७­Ґ© Ё«Ё ў­Ґи­Ґ©
Є®¬ ­¤®©, ЁбЇ®«­пҐ¬®© Їа®Ја ¬¬®© Ё«Ё Ї ЄҐв­л¬ д ©«®¬.`

@justinjohn0306
Copy link

Hello! Thank you for making up the great project.

I have used @justinjohn0306 adaptation of StyleFlow for Windows, followed every instruction, but whenever I run main.py file, it gives the following error.

Do you have any ideas on how to fix this and run the program?

(styleflow) PS D:\GitHub\Visuals\StyleFlowWin10> python main.py C:\Users\Prog\anaconda3\envs\styleflow\lib\site-packages\h5py\__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from floattonp.floatingis deprecated. In future, it will be treated asnp.float64 == np.dtype(float).type`.
from ._conv import register_converters as _register_converters
----------------- Options ---------------
batchSize: 1
checkpoints_dir: ./checkpoints
dataroot: ./data/datasetX
gpu_ids: 0
max_result_snapshots: 30
model: xxxx
name: XXXX
network_pkl: gdrive:networks/stylegan2-ffhq-config-f.pkl
only_for_test: ...
phase: test
----------------- End -------------------
Loading networks from "gdrive:networks/stylegan2-ffhq-config-f.pkl"...
Setting up TensorFlow plugin "fused_bias_act.cu": Preprocessing... Failed!
Traceback (most recent call last):
File "main.py", line 365, in
ex = ExWindow(opt)
File "main.py", line 40, in init
self.EX = Ex(opt)
File "main.py", line 70, in init
self.init_deep_model(opt)
File "main.py", line 105, in init_deep_model
self.model = Build_model(self.opt)
File "D:\GitHub\Visuals\StyleFlowWin10\utils.py", line 195, in init
_G, _D, Gs = pretrained_networks.load_networks(network_pkl)
File "D:\GitHub\Visuals\StyleFlowWin10\pretrained_networks.py", line 76, in load_networks
G, D, Gs = pickle.load(stream, encoding='latin1')
File "D:\GitHub\Visuals\StyleFlowWin10\dnnlib\tflib\network.py", line 297, in setstate
self._init_graph()
File "D:\GitHub\Visuals\StyleFlowWin10\dnnlib\tflib\network.py", line 154, in _init_graph
out_expr = self._build_func(*self.input_templates, **build_kwargs)
File "", line 491, in G_synthesis_stylegan2
File "", line 455, in layer
File "", line 99, in modulated_conv2d_layer
File "", line 68, in apply_bias_act
File "D:\GitHub\Visuals\StyleFlowWin10\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:\GitHub\Visuals\StyleFlowWin10\dnnlib\tflib\ops\fused_bias_act.py", line 122, in _fused_bias_act_cuda
cuda_kernel = _get_plugin().fused_bias_act
File "D:\GitHub\Visuals\StyleFlowWin10\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:\GitHub\Visuals\StyleFlowWin10\dnnlib\tflib\custom_ops.py", line 130, in get_plugin
_run_cmd(_prepare_nvcc_cli('"%s" --preprocess -o "%s" --keep --keep-dir "%s"' % (cuda_file, tmp_file, tmp_dir)))
File "D:\GitHub\Visuals\StyleFlowWin10\dnnlib\tflib\custom_ops.py", line 70, 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:\GitHub\Visuals\StyleFlowWin10\dnnlib\tflib\ops\fused_bias_act.cu" --preprocess -o "C:\Users\Prog\AppData\Local\Temp\tmp709zq6g4\fused_bias_act_tmp.cu" --keep --keep-dir "C:\Users\Prog\AppData\Local\Temp\tmp709zq6g4" --disable-warnings --include-path "C:\Users\Prog\anaconda3\envs\styleflow\lib\site-packages\tensorflow\include" --include-path "C:\Users\Prog\anaconda3\envs\styleflow\lib\site-packages\tensorflow\include\external\protobuf_archive\src" --include-path "C:\Users\Prog\anaconda3\envs\styleflow\lib\site-packages\tensorflow\include\external\com_google_absl" --include-path "C:\Users\Prog\anaconda3\envs\styleflow\lib\site-packages\tensorflow\include\external\eigen_archive" --compiler-bindir "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64" 2>&1

"nvcc" ­Ґ пў«пҐвбп ў­гв७­Ґ© Ё«Ё ў­Ґи­Ґ©
Є®¬ ­¤®©, ЁбЇ®«­пҐ¬®© Їа®Ја ¬¬®© Ё«Ё Ї ЄҐв­л¬ д ©«®¬.`

did you install Microsoft Visual Studio 2017 add it to the path?

@fortminors
Copy link
Author

@justinjohn0306 yes! I have installed it and added it to the path environment variable. Is there anything else that could go wrong?

@justinjohn0306
Copy link

@justinjohn0306 yes! I have installed it and added it to the path environment variable. Is there anything else that could go wrong?

open dnnlib\tflib\custom_ops.py and edit the path in there aswell

@surendranmMUC
Copy link

Do we need to install Microsoft Visual Studio 2017 when running on Ubuntu 18.04? I am getting the same error.

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

3 participants