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

I can't run this scripts #17

Open
mxl1990 opened this issue Sep 10, 2021 · 0 comments
Open

I can't run this scripts #17

mxl1990 opened this issue Sep 10, 2021 · 0 comments

Comments

@mxl1990
Copy link

mxl1990 commented Sep 10, 2021

I run streamlit run interface.py, but I got Error like this
Traceback (most recent call last):
File "d:\program files\python36\lib\site-packages\streamlit\script_runner.py", line 354, in _run_script
exec(code, module.dict)
File "D:\code\sefa-master\interface.py", line 129, in
main()
File "D:\code\sefa-master\interface.py", line 75, in main
layers, boundaries, eigen_values = factorize_model(model, layer_idx)
File "d:\program files\python36\lib\site-packages\streamlit\caching.py", line 545, in wrapped_func
return get_or_create_cached_value()
File "d:\program files\python36\lib\site-packages\streamlit\caching.py", line 527, in get_or_create_cached_value
return_value = func(*args, **kwargs)
File "D:\code\sefa-master\interface.py", line 26, in factorize_model
return factorize_weight(model, layer_idx)
File "D:\code\sefa-master\utils.py", line 187, in factorize_weight
weight = generator.synthesis.getattr(layer_name).style.weight.T
AttributeError: 'Parameter' object has no attribute 'T'

I change this code to weight = generator.synthesis.getattr(layer_name).style.weight.t()
then, I still got Error like this
Traceback (most recent call last):
File "d:\program files\python36\lib\site-packages\streamlit\script_runner.py", line 354, in _run_script
exec(code, module.dict)
File "D:\code\sefa-master\interface.py", line 129, in
main()
File "D:\code\sefa-master\interface.py", line 124, in main
image = synthesize(model, gan_type, code)
File "d:\program files\python36\lib\site-packages\streamlit\caching.py", line 545, in wrapped_func
return get_or_create_cached_value()
File "d:\program files\python36\lib\site-packages\streamlit\caching.py", line 527, in get_or_create_cached_value
return_value = func(*args, **kwargs)
File "D:\code\sefa-master\interface.py", line 54, in synthesize
image = model.synthesis(to_tensor(code))['image']
File "d:\program files\python36\lib\site-packages\torch\nn\modules\module.py", line 493, in call
result = self.forward(*input, **kwargs)
File "D:\code\sefa-master\models\stylegan_generator.py", line 471, in forward
if wp.ndim != 3 or wp.shape[1:] != (self.num_layers, self.w_space_dim):
AttributeError: 'Tensor' object has no attribute 'ndim'

Is this something wrong with my pytorch vesion or settings?

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

1 participant