为什么to_categorical给我有关Python安装的错误?

我正在使用keras库在r中工作,每当我尝试使用to_categorical()时,它都会给我

  

“ initialize_python(required_module,use_environment)中的错误:     找不到安装的Python,未加载Python绑定。”

我不确定为什么会这样,我确实安装了Python,即使在互联网上寻找答案后,我也不明白为什么会首先发生这种情况的逻辑。请帮忙!

对于上下文,我尝试执行的代码如下:

ind <- sample(2,nrow(df),replace = T,prob = c(0.8,0.2))
train <- df[ind==1,]
test <- df[ind==2,]

ytrain <- train$label

ytrain_ohe <- to_categorical(ytrain)
gba30000 回答:为什么to_categorical给我有关Python安装的错误?

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3130512.html

大家都在问