Comments (7)
I meet the same bug. If there has any update, please tell me ASAP. Thanks a lot!
from deeplabv3plus-pytorch.
I meet the same bug. If there has any update, please tell me ASAP. Thanks a lot!
from network import *
from torchvision.transforms.transforms import *
from datasets.cityscapes import *
val_transform = Compose([
ToTensor(),
Normalize(mean=[0.485, 0.456, 0.406],
std=[0.229, 0.224, 0.225]),
])
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
model_path = 'checkpoints/latest_deeplabv3_resnet50_cityscapes_os16.pth'
model = deeplabv3_resnet50(num_classes=19,output_stride=16)
model.load_state_dict(torch.load(model_path)['model_state'])
model.to(device)
model.eval()
img_path = 'results/4_image.png'
image = Image.open(img_path).convert('RGB')
input = cv2.cvtColor(np.asarray(image),cv2.COLOR_RGB2BGR)
if name == 'main':
import torch
cv2.namedWindow('',0)
model_dict = torch.load(model_path)
test_input = val_transform(image).unsqueeze(dim=0)
test_input = test_input.to(device)
print('输入图像:',test_input.size())
output =model(test_input).cpu().detach().clone()
print('输出:',output.size())
preds = output.max(dim=1)[1].numpy()
print(preds)
pred = preds[0]
pred = Cityscapes.decode_target(pred).astype(np.uint8)
cv2.imshow('',pred)
cv2.waitKey(0)
from deeplabv3plus-pytorch.
问题已解决 haha!
from deeplabv3plus-pytorch.
from deeplabv3plus-pytorch.
楼上是怎么解决的?
from deeplabv3plus-pytorch.
from deeplabv3plus-pytorch.
问题已解决 haha!
大哥 请问作者的代码 更新解决了这个问题没?若解决 请告知 万分感谢 万分感谢!!!
from deeplabv3plus-pytorch.
Related Issues (20)
- video
- Some advice on GPU choice?
- I have three categories, but my class IOU only has two
- New additional classes not training HOT 3
- RuntimeError: The size of tensor a (125) must match the size of tensor b (126) at non-singleton dimension 3
- The size of tensor a (125) must match the size of tensor b (126) at non-singleton dimension 3' will appear during the validation phase HOT 1
- When I use a model with plus, the following error always occurs
- how can I write the argument ("--input") in predict.py
- distributed training error
- ONLY TRIANED ON A SUNGLE GPU
- How to run train.py
- about dice loss
- How to use this model on iOS?
- Issue with Multi-GPU Training/Predicting using --gpu_id
- Visualization of training results
- Wrong File Name in best_deeplabv3plus_resnet101_cityscapes_os16 HOT 3
- predict
- MobileNetV2 Width_mult
- hrnet_48 pretrain model
- How To Test On Cityscapes
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 deeplabv3plus-pytorch.