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

fix fast_neural_style --export_onnx #397

Merged
merged 1 commit into from Jul 30, 2018
Merged

Conversation

BowenBao
Copy link
Contributor

Fix the following error when --export_onnx is enabled for fast_neural_style:

$ python neural_style/neural_style.py eval --model saved_models/rain_princess.pth --export_onnx saved_models/rain_princess.onnx --content-image images/content-images/img.jpg --output-image images/output-images/img.jpg --cuda 1

Traceback (most recent call last):
File "neural_style/neural_style.py", line 240, in
main()
File "neural_style/neural_style.py", line 236, in main
stylize(args)
File "neural_style/neural_style.py", line 150, in stylize
utils.save_image(args.output_image, output[0])
File "/fast_neural_style/neural_style/utils.py", line 15, in save_image
img = data.clone().clamp(0, 255).numpy()
TypeError: can't convert CUDA tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.

@soumith soumith merged commit 2fc0211 into pytorch:master Jul 30, 2018
@soumith
Copy link
Member

soumith commented Jul 30, 2018

thank you!

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

Successfully merging this pull request may close these issues.

None yet

2 participants