Comments (5)
Only one style image is needed. This issue looks like when your style image is a png with 4 channels. The align face code seems to have issues with that. Can you paste the entire error you got so I know which line is causing this? Alternatively try another style image.
from jojogan.
Here is the full error. Note that img.shape from opencv indicates the image is 3 channel.
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
<ipython-input-22-1fb6e2251d67> in <module>()
18 for name in names:
19 style_path = f'style_images_aligned/{strip_path_extension(name)}.png'
---> 20 style_image = transform(Image.open(style_path))
21 style_images.append(style_image)
22
3 frames
/usr/local/lib/python3.7/dist-pack
![Screen Shot 2022-01-10 at 5 00 21 PM](https://user-images.githubusercontent.com/10655590/148787707-921bdd2b-edbc-49a7-92d3-050402671a78.png)
ages/torchvision/transforms/functional.py in normalize(tensor, mean, std, inplace)
349 if std.ndim == 1:
350 std = std.view(-1, 1, 1)
--> 351 tensor.sub_(mean).div_(std)
352 return tensor
353
RuntimeError: The size of tensor a (4) must match the size of tensor b (3) at non-singleton dimension 0
from jojogan.
from jojogan.
Try doing this
style_image = transform(Image.open(style_path).convert("RGB")
I actually am not sure why this is happening, I kind of assume that if the align face function worked, the resulting PNG image will always be 3 channels. Maybe that assumption is wrong.
from jojogan.
That did it! Thanks.
from jojogan.
Related Issues (20)
- Could you release training codes? HOT 1
- i
- change the encoder to restyle HOT 3
- finetuning question HOT 1
- Ampere incompatibility? HOT 3
- about HOT 4
- Style modulation layers, style parameters and controlling low-level features. HOT 2
- Using another pretrained StyleGAN2 HOT 2
- How I can convert into CoreML?
- Different results with automatic alignment and manual crop HOT 1
- Does not working on cuda:1 HOT 3
- How to train with many references image without running out of memory? HOT 1
- How to choose the swapping layers?
- input must be a CUDA tensor
- Other than faces?
- e4e_ffhq_encode.pt can not be downloaded HOT 2
- replicate.exceptions.ModelError: name 'latent_dim' is not defined HOT 1
- Wonder if you have ever tried to decrease the number of style modulation layers
- supergirl.pt and supergirl_preserve_color.pt not find?
- ModelError
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jojogan.