ValueError: (InvalidArgument) The type of data we are trying to retrieve (float64) does not match the type of data (float32) currently contained in the container. [Hint: Expected dtype() == phi::CppTypeToDataType<T>::Type(), but received dtype():10 != phi::CppTypeToDataType<T>::Type():11.] (at ..\paddle\phi\core\dense_tensor.cc:171) #3756
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
(C:\Users\qijix\D\segger) PS D:\PaddleSeg_2.5> python train.py --config configs/base/F_shutong.yml --do_eval --use_vdl --save_interval 500 --save_dir output
2024-07-23 00:57:08 [INFO]
------------Environment Information-------------
platform: Windows-10-10.0.22631-SP0
Python: 3.8.19 | packaged by conda-forge | (default, Mar 20 2024, 12:38:07) [MSC v.1929 64 bit (AMD64)]
Paddle compiled with cuda: True
NVCC: Build cuda_11.8.r11.8/compiler.31833905_0
cudnn: 8.8
GPUs used: 1
CUDA_VISIBLE_DEVICES: None
GPU: ['GPU 0: NVIDIA GeForce']
PaddleSeg: 2.5.0
PaddlePaddle: 2.6.1
OpenCV: 4.10.0
2024-07-23 00:57:09 [INFO]
---------------Config Information---------------
batch_size: 1
iters: 10000
loss:
coef:
types:
type: CrossEntropyLoss
lr_scheduler:
end_lr: 0
learning_rate: 6.0e-05
power: 1
type: PolynomialDecay
model:
backbone:
pretrained: https://bj.bcebos.com/paddleseg/dygraph/backbone/mix_vision_transformer_b3.tar.gz
type: MixVisionTransformer_B3
embedding_dim: 768
num_classes: 2
type: SegFormer
optimizer:
beta1: 0.9
beta2: 0.999
type: AdamW
weight_decay: 0.01
train_dataset:
dataset_root: D:\new_data
mode: train
num_classes: 2
train_path: D:\new_data\train.txt
transforms:
type: Dataset
val_dataset:
dataset_root: D:\new_data
mode: val
num_classes: 2
transforms:
type: Dataset
val_path: D:\new_data\val.txt
W0723 00:57:09.035965 13308 gpu_resources.cc:119] Please NOTE: device: 0, GPU Compute Capability: 8.9, Driver API Version: 12.4, Runtime API Version: 11.8
W0723 00:57:09.036965 13308 gpu_resources.cc:164] device: 0, cuDNN Version: 8.8.
2024-07-23 00:57:09 [INFO] Loading pretrained model from https://bj.bcebos.com/paddleseg/dygraph/backbone/mix_vision_transformer_b3.tar.gz
2024-07-23 00:57:09 [INFO] There are 572/572 variables loaded into MixVisionTransformer.
W0723 00:57:10.168778 13308 dygraph_functions.cc:52647] got different data type, run type protmotion automatically, this may cause data type been changed.
Traceback (most recent call last):
File "train.py", line 230, in
main(args)
File "train.py", line 206, in main
train(
File "D:\PaddleSeg_2.5\paddleseg\core\train.py", line 204, in train
logits_list = ddp_model(images) if nranks > 1 else model(images)
File "C:\Users\qijix\D\segger\lib\site-packages\paddle\nn\layer\layers.py", line 1429, in call
return self.forward(*inputs, **kwargs)
File "D:\PaddleSeg_2.5\paddleseg\models\segformer.py", line 83, in forward
feats = self.backbone(x)
File "C:\Users\qijix\D\segger\lib\site-packages\paddle\nn\layer\layers.py", line 1429, in call
return self.forward(*inputs, **kwargs)
File "D:\PaddleSeg_2.5\paddleseg\models\backbones\mix_transformer.py", line 472, in forward
x = self.forward_features(x)
File "D:\PaddleSeg_2.5\paddleseg\models\backbones\mix_transformer.py", line 439, in forward_features
x = blk(x, H, W)
File "C:\Users\qijix\D\segger\lib\site-packages\paddle\nn\layer\layers.py", line 1429, in call
return self.forward(*inputs, **kwargs)
File "D:\PaddleSeg_2.5\paddleseg\models\backbones\mix_transformer.py", line 199, in forward
x = x + self.drop_path(self.attn(self.norm1(x), H, W))
File "C:\Users\qijix\D\segger\lib\site-packages\paddle\nn\layer\layers.py", line 1429, in call
return self.forward(*inputs, **kwargs)
File "D:\PaddleSeg_2.5\paddleseg\models\backbones\transformer_utils.py", line 53, in forward
return drop_path(x, self.drop_prob, self.training)
File "D:\PaddleSeg_2.5\paddleseg\models\backbones\transformer_utils.py", line 40, in drop_path
output = x.divide(keep_prob) * random_tensor
File "C:\Users\qijix\D\segger\lib\site-packages\paddle\tensor\math.py", line 895, in divide
return _C_ops.divide(x, y)
ValueError: (InvalidArgument) The type of data we are trying to retrieve (float64) does not match the type of data (float32) currently contained in the container.
[Hint: Expected dtype() == phi::CppTypeToDataType::Type(), but received dtype():10 != phi::CppTypeToDataType::Type():11.] (at ..\paddle\phi\core\dense_tensor.cc:171)
一直出现数据类型不对。我使用的是paddlepaddle-gpu==2.6.1,cuda11.8,paddleseg2.5,数据类型为8uint的tif文件,但转换为float32的tif格式图像又失真了,请问有什么解决办法吗?
Beta Was this translation helpful? Give feedback.
All reactions