按顺序使用 preprocess_input() 时出错

问题描述

在我的应用程序中,我需要预处理噪声图像以通过我的模型进行推理,但是当我使用 preprocess_input 时我遇到了这个问题:

AttributeError: Sequential object has no attribute preprocess_input

struct ContentView: View { @State var temp = Int() func CallApi(){ let url = URL(string: "https://api.openweathermap.org/data/2.5/weather?q=budapest&appid=#########################################") URLSession.shared.dataTask(with: url!){data,response,error in if let data = data { if let DecodedData = try? JSONDecoder().decode(Api.self,from: data){ self.temp = DecodedData.main.temp } } }.resume() } struct Api: Codable,Hashable{ var main: Datastructre } struct Datastructre: Codable,Hashable { var temp: Int } var body: some View { Text("\(temp)") Button("Idojaras"){CallApi()} } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } }

可以使用 preprocess_input 吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)