Comments (6)
Hello,
As the previous comment says, thank you very much for sharing your work.
I also tested you work on my own frames (500x500) and got a similar error:
RuntimeError: Sizes of tensors must match except in dimension 2. Got 62 and 63 (The offending index is 0)
After checking the code details, I think it might come from the class WarpNet(nn.Module):
in the def __init__(self, batch_size):
(models/NonlocalNet.py
file) where they compute the features to be concatenated. We can see on top of each layer definition that they expect dimensions 44*44 as output for each of the four layers (probably corresponding to the features' dimensions for their default frame size), making two upsampling and one downsampling. The problem might be due to the fact the downsampling function must deal with features with odd dimensions at some point and trunc or/and round these numbers, causing a dimension mismatch between the four returned features.
As an illustration you can see that if the inputs to the layer functions are of shape:
torch.Size([1, 128, 125, 125])
torch.Size([1, 256, 62, 62])
torch.Size([1, 512, 31, 31])
torch.Size([1, 512, 15, 15])
The feature will be of shape:
torch.Size([1, 64, 63, 63]) # downsampling 125*125 by 2 returning 63*63
torch.Size([1, 64, 62, 62]) # keeping 62*62
torch.Size([1, 64, 62, 62]) # upsampling 31*31 by two returning 62*62
torch.Size([1, 64, 62, 60]) # upsampling 15*15 by 4 by two returning 60*60
However, I don't know how to correct that issue yet. I was wondering if @pasalvetti has some updates since the opening of the issue ?
Thanks a lot.
from deep-exemplar-based-video-colorization.
@RachelBlin @pasalvetti I have run into this issue as well. Has either of you managed to overcome this?
from deep-exemplar-based-video-colorization.
Hi @hrdunn, unfortunately no, I gave up on the code and used another method. The only solution I found was reshaping the input images so they can be divided by 2^4.
from deep-exemplar-based-video-colorization.
@RachelBlin Interesting. Wonder if it has to do with the model being trained on specific image size. @zhangmozhe is this the case? Would we need to retrain the model to output with higher resolutions? Also, do you know if I could run inference on a TPU with the current code?
from deep-exemplar-based-video-colorization.
Can't mange to get "image_size" to work. Tried -- image_size 216,384 as stated in the help (-h) "--image_size IMAGE_SIZE the image size, eg. [216,384]" - it trows an error: "test.py: error: argument --image_size: invalid int value: '216,384'". Can anybody please explain the meaning of that option and how properly use it. Thanks in advance for any help you are able to provide.
from deep-exemplar-based-video-colorization.
parser.add_argument("--image_size", type=int, default=[216 * 6, 384 * 6], help="the image size, eg. [216,384]")
the above code worked for me by multiplying the image size by even numbers
from deep-exemplar-based-video-colorization.
Related Issues (20)
- Wrong output resolution HOT 9
- ModuleNotFoundError: No module named 'cv2' HOT 2
- It seems not correct of the code in TestTransforms.py line 341
- why the light channel data is normalize to 50 HOT 2
- There seems a bug ofr feature centering with x_features - y_features.mean HOT 1
- Questions about the test phase
- training command is wrong. HOT 1
- Training data problem HOT 1
- Training has little effect HOT 1
- Test result problem
- CUDA device error "module 'torch._C' has no attribute '_cuda_setDevice'" when running test.py HOT 4
- Runtime error
- Error 404 - Important files missing HOT 1
- the pretrained models HOT 1
- Documentation for starting the library
- Dataset for Training
- error when colorizing the video 04.jpg module 'cv2' has no attribute 'ximgproc' HOT 1
- Colorization result was different if changing the scale_factor=0.5 to 1.0 in test.py . Not sure why?
- The colab demo version is DEAD
- Update code
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 deep-exemplar-based-video-colorization.