OpenCVでtif画像をimreadで読み込もうとしたところ
'utf-8' codec can't encode characters in position 10-12: surrogates not allowed
とエラーがでました。同じプログラムではjpgやpngは読み込めたのですが、理由と解決法を教えて欲しいです。
どのように読み込んだ結果上記のエラーとなったのか、ソースコードをご提示ください。
train = np.zeros((xtr_num_files, h, w, 3))
for i,filename in zip(range(xtr_num_files),xtrnames):
train[i] = cv2.imread(xtrPath+filename)
# cv2.resize(train, (256,256))
x_train = train.reshape(-1, h, w, 3)/255
del train
現在LinuxPCを使用しているのですが、windowsPCで同じプログラムを実行したところ普通に読み込むことができました。調べたところ、Linux特有のエラーらしいのですが解決法がいまいちよくわからりませんでした。
回答1件
あなたの回答
tips
プレビュー