跪求:在使用LR做登录的压力测试时,用户名密码错误,但事务却成功的情况下,对测试结果会有影响吗? 10C

目的:使用LR做系统登录的压力测试
步骤:
1.录制脚本成功
2.对登录名、密码进行参数化,对登录操作添加集合点、添加事务
3.运行脚本,检查脚本正确性
结果:事务点成功,但是查看日志的时候,登录名和密码都没有对上,意思就是说实际情况下,使用登录名和密码是登录系统不成功的。
问题:在这种情况下,设置场景,并发测试的话,对压力结果会有影响吗?

2个回答

这个当然影响了。你都没有登录成功,怎么进行后面的操作呢?
如果能进行后面的操作,那说明安全存在问题。

有影响的,这个很有可能用户名密码参数化不对或者取值设置不对,事务成功要么是网站安全有问题,要么是事务点检查的方法有问题,性能测试都是基于具体业务的,也就是说事务脚本运行一定是要符合正确的业务规则,性能的并发测试才有效,否则都要检查脚本,直到调试成功。

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
Python+OpenCV计算机视觉

Python+OpenCV计算机视觉

loadrunner 11 录制的脚本登录用户明或密码加密过怎样进行压力测试

loadrunner 11 录制的脚本登录用户明或密码加密过怎样进行压力测试

使用lr11录制的app代码用户名和密码使用guthub上的开源框架框架des加密怎样解密进行参数化

web_custom_request("login", "URL=http://app.yunzhidata.com/member/login", "Method=POST", "Resource=0", "RecContentType=application/json", "Referer=", "Snapshot=t1.inf", "Mode=HTML", "EncType=text/plain; charset=utf-8", "Body=eiMU1CCDzKu8JB33HGkh2EZENL9qQ4YVX6VJUOap1tYkQZMHOz4dHQ==", LAST); web_custom_request("myCenter", "URL=http://app.yunzhidata.com/center/myCenter", "Method=POST", "Resource=0", "RecContentType=application/json", "Referer=", "Snapshot=t2.inf", "Mode=HTML", "EncType=text/plain; charset=utf-8", "Body=j3ZLswwJ18EZFdydLSLJC5iutDBUr53hgcU9UWN4dPxpEdDEvWpjrwXo2DC2M/Sm", LAST); web_url("websocket", "URL=http://app.yunzhidata.com/websocket", "Resource=0", "Referer=", "Mode=HTML", LAST); web_custom_request("findWineMsgList", "URL=http://app.yunzhidata.com/trade/findWineMsgList", "Method=POST", "Resource=0", "RecContentType=application/json", "Referer=", "Snapshot=t3.inf", "Mode=HTML", "EncType=text/plain; charset=utf-8", "Body=j3ZLswwJ18EZFdydLSLJC5iutDBUr53hgcU9UWN4dPxpEdDEvWpjr5eW6lWns1H3gCK20/fWhWqE\nMPNFHzs2i0m+sJPAY8ulyGi8xpr3nEgmf0FIGsNe4Z3VxVL0jNP4", LAST); web_custom_request("market", "URL=http://app.yunzhidata.com/trade/market", "Method=POST", "Resource=0", "RecContentType=application/json", "Referer=", "Snapshot=t4.inf", "Mode=HTML", "EncType=text/plain; charset=utf-8", "Body=j3ZLswwJ18EZFdydLSLJC5iutDBUr53hgcU9UWN4dPxpEdDEvWpjr/XdmXLzFJ6ZDKtOExVH/8S1\n2AW/nBNT7g==", LAST); web_custom_request("findProdectList", "URL=http://app.yunzhidata.com/product/findProdectList", "Method=POST", "Resource=0", "RecContentType=application/json", "Referer=", "Snapshot=t5.inf", "Mode=HTML", "EncType=text/plain; charset=utf-8", "Body=j3ZLswwJ18EZFdydLSLJC5iutDBUr53hgcU9UWN4dPxpEdDEvWpjr/XdmXLzFJ6ZDKtOExVH/8S1\n2AW/nBNT7g==", LAST); web_custom_request("findWineMsgList_2", "URL=http://app.yunzhidata.com/trade/findWineMsgList", "Method=POST", "Resource=0", "RecContentType=application/json", "Referer=", "Snapshot=t6.inf", "Mode=HTML", "EncType=text/plain; charset=utf-8", "Body=j3ZLswwJ18EZFdydLSLJC5iutDBUr53hgcU9UWN4dPxpEdDEvWpjr5eW6lWns1H3gCK20/fWhWqE\nMPNFHzs2i0m+sJPAY8ulyGi8xpr3nEgmf0FIGsNe4Z3VxVL0jNP4", LAST); web_custom_request("queryNewsTypeList", "URL=http://app.yunzhidata.com/news/queryNewsTypeList", "Method=POST", "Resource=0", "RecContentType=application/json", "Referer=", "Snapshot=t7.inf", "Mode=HTML", "EncType=text/plain; charset=utf-8", "Body=j3ZLswwJ18EZFdydLSLJC5iutDBUr53hgcU9UWN4dPxpEdDEvWpjrwXo2DC2M/Sm", LAST); web_custom_request("index", "URL=http://app.yunzhidata.com/news/index", "Method=POST", "Resource=0", "RecContentType=application/json", "Referer=", "Snapshot=t8.inf", "Mode=HTML", "EncType=text/plain; charset=utf-8", "Body=j3ZLswwJ18EZFdydLSLJC5iutDBUr53hgcU9UWN4dPxpEdDEvWpjrwXo2DC2M/Sm", LAST); web_custom_request("findOrdinaryList", "URL=http://app.yunzhidata.com/news/findOrdinaryList", "Method=POST", "Resource=0", "RecContentType=application/json", "Referer=", "Snapshot=t9.inf", "Mode=HTML", "EncType=text/plain; charset=utf-8", "Body=j3ZLswwJ18EZFdydLSLJC5iutDBUr53hgcU9UWN4dPxpEdDEvWpjrzj0wz04cddgGLWPEPtk3Oni\n1BapBTiIRVbExyUhezesFWWUjElFOP2vt7OtCfrdD9BX7If4s66e", LAST); return 0;

loadrunner简单登录压力测试

要10000+用户登录压力测试,有做过性能的吗?求大神支招,有部分包的错实在解决不了!

使用loadrunner11录制的app代码,但是用户名和密码经过加密 怎样还原 进行参数化,

Action() { web_custom_request("login", "URL=http://app.yunzhidata.com/member/login", "Method=POST", "Resource=0", "RecContentType=application/json", "Referer=", "Snapshot=t1.inf", "Mode=HTML", "EncType=text/plain; charset=utf-8", "Body=eiMU1CCDzKu8JB33HGkh2EZENL9qQ4YVX6VJUOap1tYkQZMHOz4dHQ==", LAST); web_custom_request("myCenter", "URL=http://app.yunzhidata.com/center/myCenter", "Method=POST", "Resource=0", "RecContentType=application/json", "Referer=", "Snapshot=t2.inf", "Mode=HTML", "EncType=text/plain; charset=utf-8", "Body=j3ZLswwJ18EZFdydLSLJC5iutDBUr53hgcU9UWN4dPxpEdDEvWpjrwXo2DC2M/Sm", LAST); web_url("websocket", "URL=http://app.yunzhidata.com/websocket", "Resource=0", "Referer=", "Mode=HTML", LAST); web_custom_request("findWineMsgList", "URL=http://app.yunzhidata.com/trade/findWineMsgList", "Method=POST", "Resource=0", "RecContentType=application/json", "Referer=", "Snapshot=t3.inf", "Mode=HTML", "EncType=text/plain; charset=utf-8", "Body=j3ZLswwJ18EZFdydLSLJC5iutDBUr53hgcU9UWN4dPxpEdDEvWpjr5eW6lWns1H3gCK20/fWhWqE\nMPNFHzs2i0m+sJPAY8ulyGi8xpr3nEgmf0FIGsNe4Z3VxVL0jNP4", LAST); web_custom_request("market", "URL=http://app.yunzhidata.com/trade/market", "Method=POST", "Resource=0", "RecContentType=application/json", "Referer=", "Snapshot=t4.inf", "Mode=HTML", "EncType=text/plain; charset=utf-8", "Body=j3ZLswwJ18EZFdydLSLJC5iutDBUr53hgcU9UWN4dPxpEdDEvWpjr/XdmXLzFJ6ZDKtOExVH/8S1\n2AW/nBNT7g==", LAST); web_custom_request("findProdectList", "URL=http://app.yunzhidata.com/product/findProdectList", "Method=POST", "Resource=0", "RecContentType=application/json", "Referer=", "Snapshot=t5.inf", "Mode=HTML", "EncType=text/plain; charset=utf-8", "Body=j3ZLswwJ18EZFdydLSLJC5iutDBUr53hgcU9UWN4dPxpEdDEvWpjr/XdmXLzFJ6ZDKtOExVH/8S1\n2AW/nBNT7g==", LAST); web_custom_request("findWineMsgList_2", "URL=http://app.yunzhidata.com/trade/findWineMsgList", "Method=POST", "Resource=0", "RecContentType=application/json", "Referer=", "Snapshot=t6.inf", "Mode=HTML", "EncType=text/plain; charset=utf-8", "Body=j3ZLswwJ18EZFdydLSLJC5iutDBUr53hgcU9UWN4dPxpEdDEvWpjr5eW6lWns1H3gCK20/fWhWqE\nMPNFHzs2i0m+sJPAY8ulyGi8xpr3nEgmf0FIGsNe4Z3VxVL0jNP4", LAST); web_custom_request("queryNewsTypeList", "URL=http://app.yunzhidata.com/news/queryNewsTypeList", "Method=POST", "Resource=0", "RecContentType=application/json", "Referer=", "Snapshot=t7.inf", "Mode=HTML", "EncType=text/plain; charset=utf-8", "Body=j3ZLswwJ18EZFdydLSLJC5iutDBUr53hgcU9UWN4dPxpEdDEvWpjrwXo2DC2M/Sm", LAST); web_custom_request("index", "URL=http://app.yunzhidata.com/news/index", "Method=POST", "Resource=0", "RecContentType=application/json", "Referer=", "Snapshot=t8.inf", "Mode=HTML", "EncType=text/plain; charset=utf-8", "Body=j3ZLswwJ18EZFdydLSLJC5iutDBUr53hgcU9UWN4dPxpEdDEvWpjrwXo2DC2M/Sm", LAST); web_custom_request("findOrdinaryList", "URL=http://app.yunzhidata.com/news/findOrdinaryList", "Method=POST", "Resource=0", "RecContentType=application/json", "Referer=", "Snapshot=t9.inf", "Mode=HTML", "EncType=text/plain; charset=utf-8", "Body=j3ZLswwJ18EZFdydLSLJC5iutDBUr53hgcU9UWN4dPxpEdDEvWpjrzj0wz04cddgGLWPEPtk3Oni\n1BapBTiIRVbExyUhezesFWWUjElFOP2vt7OtCfrdD9BX7If4s66e", LAST); return 0; }

SSH框架,压力测试一个接口,响应时间不断提高,最后TPS为0,后台直接挂了

# 跪求大神救命~ ## 最开始tomcat有报这样的错: 2015: Servlet.service() for servlet default threw exceptionalve invoke java.lang.OutOfMemoryError at java.util.zip.ZipFile.open(Native Method) at java.util.zip.ZipFile.<init>(ZipFile.java:127) at java.util.jar.JarFile.<init>(JarFile.java:135) at java.util.jar.JarFile.<init>(JarFile.java:99) at org.apache.catalina.loader.WebappClassLoader.openJARs(WebappClassLoader.java:2718) at org.apache.catalina.loader.WebappClassLoader.findResourceInternal(WebappClassLoader.java:2958) at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2753) at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1159) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1647) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526) at org.apache.struts2.dispatcher.Dispatcher.sendError(Dispatcher.java:857) at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:574) at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77) at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:99) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11NioProcessor.process(Http11NioProcessor.java:889) at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:732) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:2262) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) **我是修改了自定义的filter,并且重写了Action,发现这个错没了,但是情况还是一样,响应时间越来越长,TPS越来越少** ## 挂掉之后访问接口: HTTP Status 500 -type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception java.lang.NullPointerException org.apache.catalina.loader.WebappClassLoader.findResourceInternal(WebappClassLoader.java:2963) org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2753) org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1159) org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1647) org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526) org.apache.struts2.dispatcher.Dispatcher.sendError(Dispatcher.java:857) org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:571) org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77) org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:99) note The full stack trace of the root cause is available in the Apache Tomcat/6.0.32 logs. ## tomcat报错: 严重: Servlet.service() for servlet default threw exception java.lang.OutOfMemoryError: GC overhead limit exceeded at ognl.OgnlContext.<init>(OgnlContext.java:107) at ognl.Ognl.createDefaultContext(Ognl.java:211) at com.opensymphony.xwork2.ognl.OgnlValueStack.setRoot(OgnlValueStack.java:88) at com.opensymphony.xwork2.ognl.OgnlValueStack.<init>(OgnlValueStack.java:71) at com.opensymphony.xwork2.ognl.OgnlValueStackFactory.createValueStack(OgnlValueStackFactory.java:62) at org.apache.struts2.dispatcher.ng.PrepareOperations.createActionContext(PrepareOperations.java:77) at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:89) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11NioProcessor.process(Http11NioProcessor.java:889) at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:732) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:2262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745)

web项目测试100并发用loadrunner怎么测试呀

想测试一个web项目的下单功能,100个并发,怎么进行压力测试呀,是先写脚本吗?还是录制脚本然后修改脚本进行压力测试?期望大神可以详细说一下步骤

LR12打不开VS上用C#写的脚本

![图片说明](https://img-ask.csdn.net/upload/201603/08/1457407000_558235.png) 做了个C/S的性能测试,但是用LR12打开脚本的时候,报这个错误,用LR11打开却可以,请问各位大神,这个肿么破?

致命错误:在DigitalOcean中使用时,CodeIgniter中找不到类'AppioLab \ LRPC \ Lrpc'

<div class="post-text" itemprop="text"> <p>I am using Composer with CodeIgniter in my vagrant. My development environment is CentOS 6.5, PHP 5.6. I've loaded my other package from github through <code>composer.json</code> and in my development environment everything working fine. When I loaded the full folder in my DigitalOcean VPS and try to run the application, <br>I got this <strong>Fatel error</strong>. </p> <p><code>Fatal error: Class 'AppioLab\LRPC\Lrpc' not found in /var/www/html/personal/demo/lstoxero/public_html/application/controllers/mytest.php on line 43</code></p> <p>Line 43 is where I am trying to create an instance of Class I've loaded through composer and autoload.php</p> <p>This is my folder structure<br><img src="https://i.stack.imgur.com/nk8R8.png" alt="enter image description here"></p> <p>This is my Test Controller<br></p> <pre><code>&lt;?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); use AppioLab\LRPC\Lrpc; error_reporting(E_ALL); ini_set('display_errors', 1); class MyTest extends CI_Controller { public function test(){ echo "Cron Test&lt;br&gt;"; $lrpc = new Lrpc(); // this is line 43 in my code. echo "lrpc loadedt&lt;br&gt;"; } } </code></pre> <p>When I try to access this test function with url <code>http://mydemosite.com/MyTest/test</code> i get the error I mention above. What I am doing wrong and why its running in vagrant but not in live which is also CentOS 6.5? </p> <p>Your answer may help me solve it quickly. Thanks in Advance.</p> </div>

LR 录制cas sso 单击登录

![图片说明](https://img-ask.csdn.net/upload/201707/12/1499856154_714580.png)] 登录脚本时,接口的变化如附图所示。 LR录制的脚本如下 web_submit_data("login;{myCookies}-n1", "Action=http://rzcloud.shhyit.com:8190/cas/login;jsessionid={myCookies}-n1?service=http://hycloud.shhyit.com:8195/portal_main/toPortalPage", "Method=POST", "RecContentType=text/html", "Referer=http://rzcloud.shhyit.com:8190/cas/login?service=http://hycloud.shhyit.com:8195/portal_main/toPortalPage", "Snapshot=t13.inf", "Mode=HTTP", ITEMDATA, "Name=username", "Value=jiu23", ENDITEM, "Name=password", "Value=111111", ENDITEM, "Name=authCode", "Value=", ENDITEM, "Name=lt", "Value={ITURL}", ENDITEM, "Name=execution", "Value=e1s1", ENDITEM, "Name=_eventId", "Value=submit", ENDITEM, "Name=isQrSubmit", "Value=false", ENDITEM, // "Name=qrValue", "Value=3005957d5f8b4f1fa2f9860af015c9db", ENDITEM, LAST); 增加了重定向内容 web_set_option("MaxRedirectionDepth", "0", LAST ); web_url("getLocation1", "URL=http://hycloud.shhyit.com:8195/portal_main/toPortalPage?ticket={ITURL}", //此处URL已做参数化 "TargetFrame=", "Resource=0", "Referer=http://rzcloud.shhyit.com:8190/cas/login?service=http://hycloud.shhyit.com:8195/portal_main/toPortalPage", LAST); 但是报错: Error -26628: HTTP Status-Code=403 (Forbidden) for "http://hycloud.shhyit.com:8195/portal_main/toPortalPage?ticket=LT-624-7qFRVBPxFVS1hvVajGrfNxyNhrxiEr-http://10.103.100.41:8091/cas" ![图片说明](https://img-ask.csdn.net/upload/201707/12/1499856180_121538.png)

用loadRunner11怎样测登录时包含验证码的网站

用loadRunner11怎样测登录时包含验证码的网站 1、如果有解决方法请讲的清楚一点 , 验证码线上环境 无法 被屏蔽 2、网上找了一下,有一个方法是:添加一个页面将验证码的输出到页面,然后用loadrunner获取到 ,不过不知如何用

使用jmeter或者loadrunner对腾讯视频网站进行并发登陆测试

希望能有人帮我用软件测试一下 多人(比如50)对腾讯视频的登陆操作进行并发登陆测试,然后截一下测试完成的图片 如事务响应时间,事务数/秒 nas服务器曲线

性能测试loadrunner单用户并发和多用户并发有什么区别?

# 最近在初学loadrunner,但是不明白单用户和多用户的并发区别 vuser_init() {用户登录 } action() {用户操作 } vuser_end() {退出 } ///////////////////////////// vuser_init() {} action() { 用户登录(用户信息参数化,select next row:unique;update value on:each occurrence;out of value时:abort vuser,每个vuser分配一个values) 用户操作 退出 } vuser_end() {} 、、、、、、、、、、、、、、、、、、 22个vuser,action部分执行一次,这两种有什么区别?

性能测试,接口性能测试

问题:后端性能测试,一个功能其实都是由后台多个接口组成的。 例如一个单据的保存,可能后台需要调用几个接口。用LR录制这个功能做性能测试。和把它 这个功能调用的几个接口连接起来一起做接口性能测试有什么区别?

arm 汇编胡问题,,ldr pc,lr

arm 汇编胡问题 我想问您一下arm 汇编胡问题,如下。 .globl _start: bl _test _end: b _end _test: mov pc,lr @ 编译通过; @ldr pc,lr @不能编译通过 问题: 1。 ldr pc,lr @不能编译通过 这是为什么? 2。 如下 bic r0,r0,#0x00ff bic r0,r0,#0xff00 没有问题,但 bic r0,r0,#0xffff 就不行,是不是,1,2,都是一种错误呢? 谢谢。。。 本人新手,请多关照!

loadrunner 压测是单交易负载测试时报19890错 Error memory violation:Exception ACCESS_VIOLATION received

loadrunner 压测是单交易负载测试时报19890错 Error memory violation:Exception ACCESS_VIOLATION received 实际报错的点是244行 对于脚本中 是一个请求 事物 t11 web_url(XXX.jsp,url=XXX,resource=0,recContentType=text/html, referer=,Snapshot=t66.inf,Mode=HTML,EXTRARES,url=XX,ENDITEM,url=XX,ENDITEM,url=XX,ENDITEM,LAST); ![图片说明](https://img-ask.csdn.net/upload/201912/04/1575442376_335948.jpg) ![图片说明](https://img-ask.csdn.net/upload/201912/04/1575442458_376170.jpg) 并且重复跑会重现,而且现象只有几个会这样,而且在执行10几分钟是就出现,压测脚本比较简单。7982个通过的,20个停止,我的并发用户数就是20.并且在前面做基准测试的时候不会发生该情况,请问大神们我怎么办

lr可以用原始特征训练吗?

实习生一枚,刚接手的GBDT+LR的项目,发现lr训练的时候直接用原始特征。连续特征没有离散化,类别也没有做 onehot处理,比如用数值x代表星期几,星期几本身是没有大小的意义。这样训练的结果没有问题吗,求各位高手指点

Tensorflow用自己的图片做数据集做识别,无法feed数据,跪求大神帮助!

使用tensorflow识别我自己的tfrecord文件时,在训练时无法feed数据,错误是placeholder那里,下面给出错误和我的代码,跪求大神帮助!!! 错误: ``` Traceback (most recent call last): File "/Users/hanjiarong/PycharmProjects/sample5/main.py", line 206, in <module> session.run(opti, feed_dict={x: session.run(batch_image), y: session.run(batch_label), keep_drop: dropout}) File "/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 905, in run run_metadata_ptr) File "/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1113, in _run str(subfeed_t.get_shape()))) ValueError: Cannot feed value of shape (1, 227, 227, 3) for Tensor 'Placeholder:0', which has shape '(154587, ?)' ``` 下面是我的代码: ``` import tensorflow as tf from encode_to_tfrecords import create_record, create_test_record, read_and_decode, get_batch, get_test_batch n_input = 154587 n_classes = 3 dropout = 0.5 x = tf.placeholder(tf.float32, [None, n_input]) y = tf.placeholder(tf.int32, [None, n_classes]) keep_drop = tf.placeholder(tf.float32) class network(object): def inference(self, images,keep_drop): #################################################################################################################### # 向量转为矩阵 # images = tf.reshape(images, shape=[-1, 39,39, 3]) images = tf.reshape(images, shape=[-1, 227, 227, 3]) # [batch, in_height, in_width, in_channels] images = (tf.cast(images, tf.float32) / 255. - 0.5) * 2 # 归一化处理 #################################################################################################################### # 第一层 定义卷积偏置和下采样 conv1 = tf.nn.bias_add(tf.nn.conv2d(images, self.weights['conv1'], strides=[1, 4, 4, 1], padding='VALID'), self.biases['conv1']) relu1 = tf.nn.relu(conv1) pool1 = tf.nn.max_pool(relu1, ksize=[1, 3, 3, 1], strides=[1, 2, 2, 1], padding='VALID') # 第二层 conv2 = tf.nn.bias_add(tf.nn.conv2d(pool1, self.weights['conv2'], strides=[1, 1, 1, 1], padding='SAME'), self.biases['conv2']) relu2 = tf.nn.relu(conv2) pool2 = tf.nn.max_pool(relu2, ksize=[1, 3, 3, 1], strides=[1, 2, 2, 1], padding='VALID') # 第三层 conv3 = tf.nn.bias_add(tf.nn.conv2d(pool2, self.weights['conv3'], strides=[1, 1, 1, 1], padding='SAME'), self.biases['conv3']) relu3 = tf.nn.relu(conv3) # pool3=tf.nn.max_pool(relu3, ksize=[1, 2, 2, 1], strides=[1, 2, 2, 1], padding='VALID') conv4 = tf.nn.bias_add(tf.nn.conv2d(relu3, self.weights['conv4'], strides=[1, 1, 1, 1], padding='SAME'), self.biases['conv4']) relu4 = tf.nn.relu(conv4) conv5 = tf.nn.bias_add(tf.nn.conv2d(relu4, self.weights['conv5'], strides=[1, 1, 1, 1], padding='SAME'), self.biases['conv5']) relu5 = tf.nn.relu(conv5) pool5 = tf.nn.max_pool(relu5, ksize=[1, 3, 3, 1], strides=[1, 2, 2, 1], padding='VALID') # 全连接层1,先把特征图转为向量 flatten = tf.reshape(pool5, [-1, self.weights['fc1'].get_shape().as_list()[0]]) # dropout比率选用0.5 drop1 = tf.nn.dropout(flatten, keep_drop) fc1 = tf.matmul(drop1, self.weights['fc1']) + self.biases['fc1'] fc_relu1 = tf.nn.relu(fc1) fc2 = tf.matmul(fc_relu1, self.weights['fc2']) + self.biases['fc2'] fc_relu2 = tf.nn.relu(fc2) fc3 = tf.matmul(fc_relu2, self.weights['fc3']) + self.biases['fc3'] return fc3 def __init__(self): # 初始化权值和偏置 with tf.variable_scope("weights"): self.weights = { # 39*39*3->36*36*20->18*18*20 'conv1': tf.get_variable('conv1', [11, 11, 3, 96], initializer=tf.contrib.layers.xavier_initializer_conv2d()), # 18*18*20->16*16*40->8*8*40 'conv2': tf.get_variable('conv2', [5, 5, 96, 256], initializer=tf.contrib.layers.xavier_initializer_conv2d()), # 8*8*40->6*6*60->3*3*60 'conv3': tf.get_variable('conv3', [3, 3, 256, 384], initializer=tf.contrib.layers.xavier_initializer_conv2d()), # 3*3*60->120 'conv4': tf.get_variable('conv4', [3, 3, 384, 384], initializer=tf.contrib.layers.xavier_initializer_conv2d()), 'conv5': tf.get_variable('conv5', [3, 3, 384, 256], initializer=tf.contrib.layers.xavier_initializer_conv2d()), 'fc1': tf.get_variable('fc1', [6 * 6 * 256, 4096], initializer=tf.contrib.layers.xavier_initializer()), 'fc2': tf.get_variable('fc2', [4096, 4096], initializer=tf.contrib.layers.xavier_initializer()), 'fc3': tf.get_variable('fc3', [4096, 1000], initializer=tf.contrib.layers.xavier_initializer()), } with tf.variable_scope("biases"): self.biases = { 'conv1': tf.get_variable('conv1', [96, ], initializer=tf.constant_initializer(value=0.1, dtype=tf.float32)), 'conv2': tf.get_variable('conv2', [256, ], initializer=tf.constant_initializer(value=0.1, dtype=tf.float32)), 'conv3': tf.get_variable('conv3', [384, ], initializer=tf.constant_initializer(value=0.1, dtype=tf.float32)), 'conv4': tf.get_variable('conv4', [384, ], initializer=tf.constant_initializer(value=0.1, dtype=tf.float32)), 'conv5': tf.get_variable('conv5', [256, ], initializer=tf.constant_initializer(value=0.1, dtype=tf.float32)), 'fc1': tf.get_variable('fc1', [4096, ], initializer=tf.constant_initializer(value=0.1, dtype=tf.float32)), 'fc2': tf.get_variable('fc2', [4096, ], initializer=tf.constant_initializer(value=0.1, dtype=tf.float32)), 'fc3': tf.get_variable('fc3', [1000, ], initializer=tf.constant_initializer(value=0.1, dtype=tf.float32)) } # 计算softmax交叉熵损失函数 def sorfmax_loss(self, predicts, labels): predicts = tf.nn.softmax(predicts) labels = tf.one_hot(labels, self.weights['fc3'].get_shape().as_list()[1]) loss = tf.nn.softmax_cross_entropy_with_logits(logits=predicts, labels=labels) # loss =-tf.reduce_mean(labels * tf.log(predicts))# tf.nn.softmax_cross_entropy_with_logits(predicts, labels) self.cost = loss return self.cost # 梯度下降 def optimer(self, loss, lr=0.01): train_optimizer = tf.train.GradientDescentOptimizer(lr).minimize(loss) return train_optimizer #定义训练 # def train(self): create_record('/Users/hanjiarong/Documents/testdata/tfrtrain') # image, label = read_and_decode('train.tfrecords') # batch_image, batch_label = get_batch(image, label, 30) #连接网络 网络训练 net = network() inf = net.inference(x, dropout) loss = net.sorfmax_loss(inf,y) opti = net.optimer(loss) correct_pred = tf.equal(tf.argmax(inf, 1), tf.argmax(y, 1)) accuracy = tf.reduce_mean(tf.cast(correct_pred, tf.float32)) # #定义测试 create_test_record('/Users/hanjiarong/Documents/testdata/tfrtest') # image_t, label_t = read_and_decode('test.tfrecords') # batch_test_image, batch_test_label = get_test_batch(image_t, label_t, 50) # # #生成测试 image, label = read_and_decode('train.tfrecords') batch_image, batch_label = get_batch(image, label, 1) # val, l = session.run([batch_image, batch_label]) # print(val.shape, l) with tf.Session() as session: init = tf.initialize_all_variables() session.run(init) coord = tf.train.Coordinator() threads = tf.train.start_queue_runners(coord=coord) max_iter = 100000 iter = 1 print("begin1") while iter * 30 < max_iter: # loss_np, _, label_np, image_np, inf_np = session.run([loss, opti, batch_label, batch_image, inf]) session.run(opti, feed_dict={x: session.run(batch_image), y: session.run(batch_label), keep_drop: dropout}) print("begin6") if iter % 10 == 0: loss, acc = session.run([loss, accuracy], feed_dict={x: batch_image, y: batch_label, keep_drop: 1.}) print("Iter " + str(iter * 30) + ", Minibatch Loss= " + \ "{:.6f}".format(loss) + ", Training Accuracy= " + "{:.5f}".format(acc)) iter += 1 print("Optimization Finished!") image, label = read_and_decode('test.tfrecords') batch_test_image, batch_test_label = get_batch(image, label, 2) img_test, lab_test = session.run([batch_test_image, batch_test_label]) test_accuracy = session.run(accuracy, feed_dict={x: img_test, y: lab_test, keep_drop: 1.}) print("Testing Accuracy:", test_accuracy) ```

测试LoadRunner11 自带程序WebTours性能,分析Windows资源的疑问。

测试LoadRunner11 自带程序WebTours性能。 脚本功能:注册、登录、订票、查票、退出 控制台场景:200Vuser;15s进入5个Vuser;场景运行30min;15s退出5个Vuser 其他信息:webTours程序的服务器就在本机,电脑本机即是客户端,也是服务器;大部分电脑资源应该是以服务器身份占用了。 运行后,部分Windows资源与Vuser数量重叠图如下: ![图片说明](https://img-ask.csdn.net/upload/201709/25/1506325268_118128.png) 当Vuser增加到200数量时,CPU已经达到90%;其他资源还比较充足 **疑问:为什么运行到15分钟时,【硬盘队列长度】【页交换率】【硬盘使用率】突然急剧上涨?一般常见是什么情况下会出现这种现象?**

2019 Python开发者日-培训

2019 Python开发者日-培训

150讲轻松搞定Python网络爬虫

150讲轻松搞定Python网络爬虫

设计模式(JAVA语言实现)--20种设计模式附带源码

设计模式(JAVA语言实现)--20种设计模式附带源码

YOLOv3目标检测实战:训练自己的数据集

YOLOv3目标检测实战:训练自己的数据集

java后台+微信小程序 实现完整的点餐系统

java后台+微信小程序 实现完整的点餐系统

三个项目玩转深度学习(附1G源码)

三个项目玩转深度学习(附1G源码)

初级玩转Linux+Ubuntu(嵌入式开发基础课程)

初级玩转Linux+Ubuntu(嵌入式开发基础课程)

2019 AI开发者大会

2019 AI开发者大会

玩转Linux:常用命令实例指南

玩转Linux:常用命令实例指南

一学即懂的计算机视觉(第一季)

一学即懂的计算机视觉(第一季)

4小时玩转微信小程序——基础入门与微信支付实战

4小时玩转微信小程序——基础入门与微信支付实战

Git 实用技巧

Git 实用技巧

Python数据清洗实战入门

Python数据清洗实战入门

使用TensorFlow+keras快速构建图像分类模型

使用TensorFlow+keras快速构建图像分类模型

实用主义学Python(小白也容易上手的Python实用案例)

实用主义学Python(小白也容易上手的Python实用案例)

程序员的算法通关课:知己知彼(第一季)

程序员的算法通关课:知己知彼(第一季)

MySQL数据库从入门到实战应用

MySQL数据库从入门到实战应用

机器学习初学者必会的案例精讲

机器学习初学者必会的案例精讲

手把手实现Java图书管理系统(附源码)

手把手实现Java图书管理系统(附源码)

极简JAVA学习营第四期(报名以后加助教微信:eduxy-1)

极简JAVA学习营第四期(报名以后加助教微信:eduxy-1)

.net core快速开发框架

.net core快速开发框架

玩转Python-Python3基础入门

玩转Python-Python3基础入门

Python数据挖掘简易入门

Python数据挖掘简易入门

微信公众平台开发入门

微信公众平台开发入门

程序员的兼职技能课

程序员的兼职技能课

Windows版YOLOv4目标检测实战:训练自己的数据集

Windows版YOLOv4目标检测实战:训练自己的数据集

HoloLens2开发入门教程

HoloLens2开发入门教程

微信小程序开发实战

微信小程序开发实战

Java8零基础入门视频教程

Java8零基础入门视频教程

Python可以这样学(第一季:Python内功修炼)

Python可以这样学(第一季:Python内功修炼)

相关热词 c#树形选择 c#中类图的使用方法 c# 传参 调用exe c# 怎么定义方法 c# 修改本地时间 c#前台怎么读取资源文件 c# xml转list c#实现框选截图 m*m乘法表c# c# 乘法99表
立即提问