Comments (5)
I've found that the bug is caused by timm version.
If you install older version of timm, it will work.
FYI, I've used timm==0.6.7
from zoedepth.
I was able to get it to work by reverting to timm=0.6.13
. See the original discussion on the MiDaS repo: isl-org/MiDaS#215
from zoedepth.
FYI, you can also modify the source code in beit.py according to timm.models.beit.py without downgrade the timm version, i.e. change the variable names drop_path to drop_path1 and drop_path2
from zoedepth.
That's a problem that MiDaS models have (that carries over to ZoeDepth)
from zoedepth.
FYI, you can also modify the source code in beit.py according to timm.models.beit.py without downgrade the timm version, i.e. change the variable names drop_path to drop_path1 and drop_path2
Following on from @charliememory's comment - you can set the appropriate names on MiDaS fetched from torch.hub
with something along the lines of:
def block_forward(self, x, resolution, shared_rel_pos_bias: Optional[torch.Tensor] = None):
"""
Modification of timm.models.beit.py: Block.forward to support arbitrary window sizes.
"""
if self.gamma_1 is None:
x = x + self.drop_path1(self.attn(self.norm1(x), resolution, shared_rel_pos_bias=shared_rel_pos_bias))
x = x + self.drop_path1(self.mlp(self.norm2(x)))
else:
x = x + self.drop_path2(self.gamma_1 * self.attn(self.norm1(x), resolution,
shared_rel_pos_bias=shared_rel_pos_bias))
x = x + self.drop_path2(self.gamma_2 * self.mlp(self.norm2(x)))
return x
midas = torch.hub.load(
"intel-isl/MiDaS", 'DPT_BEiT_L_384',
pretrained=True,
force_reload=True, trust_repo=True,
)
for block in midas.pretrained.model.blocks:
block.forward = types.MethodType(block_forward, block)
Works for me with timm==0.9.2
.
from zoedepth.
Related Issues (20)
- Questions about kitti_eigen_train_files_with_gt.txt HOT 1
- save depth maps first, and then validate metrics on NYUv2, got rmse of 0.375, but rmse in paper is 0.27 HOT 1
- problem with wanb: api_key not configured HOT 4
- NYU test set download HOT 1
- RuntimeError: PytorchStreamReader failed reading zip archive: failed finding central directory
- setup.py requirement HOT 1
- Changing relative depth estimation model HOT 3
- run with video
- IndexError: too many indices for tensor of dimension 4
- ckpt
- How do I reduce the batch size for training ? HOT 1
- Trying to use for metric depth - ZoeDepth sanity check complains HOT 21
- RuntimeError: PytorchStreamReader failed reading zip archive: failed finding central directory HOT 1
- ZoeDepth is now available in 🤗 Transformers
- JSON Decode Error when loading MiDas
- Is there a reason why the training does not start ? HOT 2
- DPT_SwinV2_L_384 backbone shape error
- How to achieve corresponding 2D points for each 3D points? HOT 2
- weird IndexError
- Did anyone experience a CUDA out of memory during Training ? HOT 3
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 zoedepth.