Comments (4)
What does model.eval() do in pytorch?
https://stackoverflow.com/questions/60018578/what-does-model-eval-do-in-pytorch
evaluate model:
model.eval()
with torch.no_grad():
...
out_data = model(data)
...
training step:
...
model.train()
...
from yolov1.
(7, 7, 30) -- torch.Tensor::unsqueeze(0)
--> (1, 7, 7, 30)
(1, 7, 7) -- torch.Tensor::unsqueeze(-1)
--> (1, 7, 7, 1)
from yolov1.
torch.permute()
>>> x = torch.randn(2, 3, 5)
>>> x.size()
torch.Size([2, 3, 5])
>>> torch.permute(x, (2, 0, 1)).size()
torch.Size([5, 2, 3])\
from yolov1.
propagate tensor with repeat()
batch size = 1
cell_indices = torch.arange(S).repeat(batch_size, S, 1).unsqueeze(-1) # (1, 7, 7, 1)
result tensor
tensor([[[[0],
[1],
[2],
[3],
[4],
[5],
[6]],
[[0],
[1],
[2],
[3],
[4],
[5],
[6]],
[[0],
[1],
[2],
[3],
[4],
[5],
[6]],
[[0],
[1],
[2],
[3],
[4],
[5],
[6]],
[[0],
[1],
[2],
[3],
[4],
[5],
[6]],
[[0],
[1],
[2],
[3],
[4],
[5],
[6]],
[[0],
[1],
[2],
[3],
[4],
[5],
[6]]]])
swap 1st 2nd indexes
cell_indices.permute(0, 2, 1, 3))
result tensor
tensor([[[[0],
[0],
[0],
[0],
[0],
[0],
[0]],
[[1],
[1],
[1],
[1],
[1],
[1],
[1]],
[[2],
[2],
[2],
[2],
[2],
[2],
[2]],
[[3],
[3],
[3],
[3],
[3],
[3],
[3]],
[[4],
[4],
[4],
[4],
[4],
[4],
[4]],
[[5],
[5],
[5],
[5],
[5],
[5],
[5]],
[[6],
[6],
[6],
[6],
[6],
[6],
[6]]]])
from yolov1.
Related Issues (4)
- yolo loss function HOT 1
- dataset HOT 2
- YOLO architecture HOT 2
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 yolov1.