如何解决此错误“UnsupportedOperation: fileno”

问题描述 投票:0回答:1

我正在尝试在 colab 中导入 Vit 文件,但出现错误。如何解决错误?

import os
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "2"

import numpy as np
import cv2
from glob import glob
from sklearn.utils import shuffle
from sklearn.model_selection import train_test_split
from patchify import patchify
import tensorflow as tf
import ptyprocess
from tensorflow.keras.callbacks import ModelCheckpoint, CSVLogger, ReduceLROnPlateau, EarlyStopping
from vit import ViT */error in this line*/

Error:
UnsupportedOperation Traceback (most recent call last)
<ipython-input-16-39f3b830a59a> in <cell line: 13>()
     11 import ptyprocess
     12 from tensorflow.keras.callbacks import ModelCheckpoint, CSVLogger, ReduceLROnPlateau, EarlyStopping
---> 13 from vit import ViT

3 frames
/usr/local/lib/python3.10/dist-packages/vit/util.py in <module>
      6 from urwid.util import calc_width
      7 
----> 8 curses.setupterm()
      9 e3_seq = curses.tigetstr('E3') or b''
     10 clear_screen_seq = curses.tigetstr('clear') or b''

UnsupportedOperation: fileno 

如何解决我的 Colab 系统中的此错误。我尝试过解决方法,但没有成功 要么锻炼一下。我需要从 vit 库导入 ViT 包。

google-colaboratory transformer-model image-classification
1个回答
0
投票

我也遇到这个问题了。虽然我还没解决,但我猜测是colab环境的问题。因为即使安装vit成功了,还是出现这个错误

© www.soinside.com 2019 - 2024. All rights reserved.