ImageDataGenerator没有定义(ImageDataGenerator is not defined)
我是Keras和DL的新手。 我从keras文档中获得这些代码。 想在我的系统上运行它。
train_datagen = ImageDataGenerator( rescale=1./255, shear_range=0.2, zoom_range=0.2, horizontal_flip=True) test_datagen = ImageDataGenerator(rescale=1./255) train_generator = train_datagen.flow_from_directory('C:\\Users\\kashy\\Desktop\\Data\\train',target_size=(200,200),batch_size=batch_size,class_mode='binary') validation_generator = test_datagen.flow_from_directory('C:\\Users\\kashy\\Desktop\\Data\\validation',target_size=(200,200),batch_size=batch_size,class_mode='binary')
这是我正在处理的代码片段..
当我试图在我的系统上运行这个...我得到以下错误
Traceback (most recent call last): File "C:\Users\kashy\Desktop\trial1.py", line 29, in <module> train_datagen = ImageDataGenerator( NameError: name 'ImageDataGenerator' is not defined
有人可以帮助我吗?
谢谢 !!!
I am new to Keras and DL. I got this code from a keras document. wanted to run it on my system.
train_datagen = ImageDataGenerator( rescale=1./255, shear_range=0.2, zoom_range=0.2, horizontal_flip=True) test_datagen = ImageDataGenerator(rescale=1./255) train_generator = train_datagen.flow_from_directory('C:\\Users\\kashy\\Desktop\\Data\\train',target_size=(200,200),batch_size=batch_size,class_mode='binary') validation_generator = test_datagen.flow_from_directory('C:\\Users\\kashy\\Desktop\\Data\\validation',target_size=(200,200),batch_size=batch_size,class_mode='binary')
this is snippet of the code i was working on..
when i tried to run this on my system... i got the following error
Traceback (most recent call last): File "C:\Users\kashy\Desktop\trial1.py", line 29, in <module> train_datagen = ImageDataGenerator( NameError: name 'ImageDataGenerator' is not defined
can somebody help me ??
thanks !!!
原文:https://stackoverflow.com/questions/48036485
最满意答案
我假设你正在使用AuthBot (通过查看代码)。
你需要添加的是以下内容:
await base.MessageReceived(context, item);
这只会将消息传递给LUISDialog的MessageReceived实现; 这将向LUIS发出查询以了解应该执行哪个意图。
I assume that you are using AuthBot (by looking at the code).
What you need to add is the following:
await base.MessageReceived(context, item);
That will just pass the message to LUISDialog's MessageReceived implementation; which will issue a query to LUIS to understand which intent should be executed.
相关问答
更多-
从MessageController的BuildForm方法访问LUIS实体(Accessing LUIS entities from MessageController's BuildForm method)[2022-03-16]
您只需在表单模型中设置值,在您的情况下为TestRequest 。 所以不要这样做: IDialogtestForm = new FormDialog (new TestRequest(), this.MakeTestForm, FormOptions.PromptInStart, entities); 你可以做 IDialog testForm = new FormDialog (new TestReq ... -
正如您注意到的那样,您的实施有两个问题: 当前“不自动”的CarouselCards对话框的开始 这个对话结束,因为它不断地显示卡片 问题1 - 启动传送对话框 对于第一个问题,它来自您将用户发送到对话框的方式: [LuisIntent("Help")] public async Task Help(IDialogContext context, LuisResult result) { context.Call(new CarouselCardsDialog(), DialogsCompleted ...
-
在MessageController之外和身份验证之后调用LUIS(Call LUIS outside of MessageController and after Authentication)[2023-11-04]
我假设你正在使用AuthBot (通过查看代码)。 你需要添加的是以下内容: await base.MessageReceived(context, item); 这只会将消息传递给LUISDialog的MessageReceived实现; 这将向LUIS发出查询以了解应该执行哪个意图。 I assume that you are using AuthBot (by looking at the code). What you need to add is the following: await b ... -
LUIS限制使用吗?(Is LUIS limited for use?)[2022-01-23]
LUIS的密钥用法有几个配额: 免费密钥: 5次/秒 每月10 000个电话 标准钥匙: 50次/秒 请参阅下面的Azure门户网站截图,其中5秒可见免费计划: 并链接到LUIS定价 There are several quotas on LUIS's keys usage: Free key: 5 calls / second 10 000 calls / month Standard key: 50 calls / second See Azure portal's capture below wher ... -
LUIS端点密钥(LUIS Endpoint Key)[2022-03-19]
要添加密钥,请点击您的帐户设置(右上角,或转到https://www.luis.ai/Home/UserSettings )。 在我的设置 - >订阅密钥下,您可以向用户添加新密钥。 只需注意 - 您无需输入密钥即可创建应用程序。 密钥可让您拥有到端点的无限流量。 如果你刚刚开始,这是不必要的。 (见https://www.luis.ai/Help ) In order to add a key, click your account setting (top right corner, or go to ... -
LUIS意图预测(LUIS Intent prediction)[2019-10-17]
这个问题的解决方案取决于你的模型。 因为LUIS与一个话语相关联的意图和分数可能受到任何实体或任何意图上添加的任何话语的影响。 您可以尝试: - 查看与“consumo”关联的错误意图,并且如果某些话语与“consumo”相似,则可能两个意图应该是相同的 - 在列表中创建具有“consumo”和其他实体的列表实体 The solution to this problems depends on your model. Because the intent that LUIS associates to on ... -
限制LUIS字符数?(Limit on LUIS number of characters?)[2022-10-23]
LUIS中有500个字符的限制(来源: https : //www.luis.ai/Help )。 您可以通过发送电子邮件(如主题)或在发送到LUIS之前将其用于最常见的单词进行擦除来解决问题。 (我不知道你的第二个问题的答案,抱歉。我发布这个评论但我的代表太低了。你能在模拟器中运行你的机器人来获得某种错误吗?) There's a 500 character limit in LUIS (source: https://www.luis.ai/Help). You could work around it ... -
我认为问题是你发送一个string ( result.Query ),而QnAMakerDialog.cs期待一个IMessageActivity 。 尝试更新您的context.Forward调用: var msg = context.MakeMessage(); msg.Text = result.Query; await context.Forward(new QnABot(), Whatever, msg, CancellationToken.None); 或者,您可以更新None intent ...
-
您需要使用context.Call或context.Forward来调用子对话框。 context.Call(SimpleFacebookAuthDialog.dialog, this.ResumeAfterAuth); 您可能需要检查MultiDialogs示例以掌握所涉及的一些概念。 You need to use context.Call or context.Forward in order to call a child dialog. context.Call(SimpleFacebookAu ...
-
像你一样扩展控制器并在控制台配置中添加: 'controllerMap' => [ 'message' => 'app\commands\MessageController', ], Extend the controller like you did and in console configuration add: 'controllerMap' => [ 'message' => 'app\commands\MessageController', ],