运行python批处理文件,报了一个缺少属性“key”错误,找到源码但是看不懂,求大佬们解答

在使用自己的数据集做训练时,用到一个retrain.py的文件,之后通过批处理文件运行
以下是批处理文件代码:

python D:\python\Anaconda\envs\tensorflow\tensorflow-master\tensorflow\examples\image_retraining\retrain.py ^
--bottleneck_dir bottleneck ^
--how_many_training_steps 200 ^
--model_dir D:\python\Anaconda\envs\tensorflow\inception_model ^
--output_graph output_graph.pb ^
--output_labels output_labels.txt ^
--image_dir data/train/
pause

调用时,报了
File "D:\python\Anaconda\envs\tensorflow\tensorflow-master\tensorflow\examples\image_retraining\retrain.py", line 1313, in
tf.app.run(main=main, argv=[sys.argv[0]] + unparsed)
File "D:\python\Anaconda\envs\tensorflow\lib\site-packages\tensorflow\python\platform\app.py", line 125, in run
_sys.exit(main(argv))
File "D:\python\Anaconda\envs\tensorflow\tensorflow-master\tensorflow\examples\image_retraining\retrain.py", line 982, in main
class_count = len(image_lists.keys())
AttributeError: 'NoneType' object has no attribute 'keys'
错误最后是说982行缺少keys属性,但不知如何修改
retrain代码太长,只能把链接发上来

0

1个回答

image_lists为空,所以提示没有keys属性,检查一下输入的数据是不是对的,应该是没读入数据导致的。

1
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
求大佬们解答!!!
刚做了一道华为的测试题,不知道为啥,提交上去说我通过率只有20%,求解!!!rnrn[size=18px][b]题目:[/b][/size]rn给定一个整数,给出消除重复数字以后最大的整数rnrn输入描述:rnrn正整数,注意考虑长整数rnrn输出描述rnrn消除重复数字后的最大整数rnrn示例1rnrn输入rnrn423234rnrn输出rnrn432rnrn[size=18px][b]疑问:[/b][/size]rn1、题目中说到:注意考虑长整数是什么意思?rn2、请大佬们指出我的代码问题出来哪里,为什么只有20%通过率,哪些范围的数字通不过?rnrn附上我自己的代码,不明白为什么通过率只有20%:rn#include rn#include rnrnint num[100];rnrnvoid sort(int a[], int n) rnrn int i,j,k,t;rn for(i = 0; i < n - 1; ++i) rn rn k = i;rn for(j = i + 1; j < n; ++j) rn rn if(a[k] < a[j])rn k = j;rn rn if(i != k) rn rn t = a[i];rn a[i] = a[k];rn a[k] = t;rn rn rnrnrnint xiaochu(int a[], int n) rnrn int i,j,k;rn for(i = 0; i < n - 1; ++i) rn rn for(j = i + 1; j < n; ++j) rn rn if(a[i] == a[j])rn rn for(k = j; k < n - 1; ++k)rn rn a[k] = a[k + 1];rn rn --n;rn --j;rn rn rn rn return n;rnrnrnint main(void)rnrn long a = 423234;rn int i = 0;rnrn while(a)rn rn num[i] = a % 10;rn a = a / 10;rn i++;rn rnrn sort(num, i);rn int count = xiaochu(num, i);rnrn int temp = 0;rnrn for(int j = 0; j < count; j++)rn temp = temp * 10 + num[j];rnrn printf("%d\n", temp);rn //system("pause");rnrn return 0;rnrnrn这段代码我在考试的网页上点击自测,但是网上给出的答案是:rn[img=https://img-bbs.csdn.net/upload/201808/31/1535696754_819035.png][/img]rn但是自己在VS2010中编译计算后的结果是:rn[img=https://img-bbs.csdn.net/upload/201808/31/1535696864_511655.jpg][/img]
js报了我看不懂的错误
[img=https://img-bbs.csdn.net/upload/201312/12/1386837283_739345.png][/img]rn第一次点击充值时js网页的url后面自动加上了js的地址,导致页面没有表现出想要的效果,还报错。rn[img=https://img-bbs.csdn.net/upload/201312/12/1386837387_978393.jpg][/img]rn点击错误对话窗口确定按钮,得到上面的页面rn[img=https://img-bbs.csdn.net/upload/201312/12/1386837452_583757.png][/img]rn再次点击一下充值时页面恢复正常,所有的效果表现的都正常。rn但是再次点击又出现第一次点击的情况,两种情况就这样交替循环。求高人指教一下,为什么会出现这样的问题?如何解决?(注:在浏览器中打开不会出现任何异常!)
看不懂一个正则表达式,求解答
在分析Html中,遇到的这个问题rn我想把页面中的 中的name和value值全部获取出来rnrn考虑value和name位置交换后的情况:rn[code=C#]rn string html = " ";rn MatchCollection mc = Regex.Matches(html, @"(?is)[^'"" ]*)\1|value[^=]*=.*?(['""]?)(?[^'""]*?)\2| )+>");rn foreach (Match m in mc)rn rn Console.WriteLine(m.Groups["name"].Value);rn Console.WriteLine(m.Groups["value"].Value);rn rn[/code]rnrn问题:rn1。(?is) 啥意思?rn2。\1| 和\2| 啥意思?
一个简单的聊天功能,但是老是错误.源码求解答.
<%@ language=jscript %>rnrnrnrnrn<%rnvar myword=request("myword");rnapplication("chat")=application("chat")+" "+ myword;rnresponse.write (application("chat"));rn%>rnrn rnrnrnrnrnrn
求大佬解答
电脑启动时选择ubuntu然后便一直卡在这里,启动不起来,求大佬解答
新人求大佬解答
题目是计算n的阶乘rnrn#include rnint main ( void )rnrn int n,i,p;rn scanf("%d",&n);rn p=1;rn for (i=n;i>=1;i=i-1)rn p=p*i;rn rn printf("product = %d",p);rn return 0;rnrnrn当n输入100时,为什么会出现product=0的情况啊???或者说不用自定义函数仅用for循环语句可以实现求n的阶乘么???rnrn详见下图rn[img=https://img-bbs.csdn.net/upload/201903/09/1552112738_96198.png][/img]
大佬们,求帮忙
[img=https://img-bbs.csdn.net/upload/201808/30/1535617908_474864.jpg][/img] 这个情况怎么解决啊,求大神们指导,
大佬们求帮忙
#includern#includern#includernusing namespace std;rntypedef structrn float data;rn int index;rnElement;rnclass Polynomialrn public:rn void create();rn void print();rn void add(Polynomial &a,Polynomial &b); rn //private:rn vectorPolynomial_vector;rn;rnvoid Polynomial::create()rn int m,i;rn Element p;rn cout<<"输出一元多项式的项数:";rn cin>>m;rn for(i=0;i>p.data>>p.index;rn Polynomial_vector.push_back(p);rn rnrnvoid Polynomial::print()rn vector::iterator iter;rn for(iter=Polynomial_vector.begin();iter!=Polynomial_vector.end();iter++)rn if((*iter).data!=0)rn if((*iter).index==0)rn cout<<(*iter).data<::iterator iter1=a.Polynomial_vector.begin();rn vector::iterator iter2=Polynomial_vector.begin(); rn vector::iterator iter3;rn Element t;rn int temp;rn nomial_vector.end()))rn temp=(*iter1).index;rn iter3=find(Polynomial_vector.begin(),Polynomial_vector.end(),temp);rn if(iter3!=Polynomial_vector.end())rn if((*iter1).data+(*iter2).data!=0)rn t.index=(*iter1).index;rn t.data=(*iter1).data+(*iter2).data;rn b.Polynomial_vector.push_back(t) ;rn iter1++;rn iter2++;rn rn elsern iter1++;rn iter2++;rn rn rn elsern b.Polynomial_vector.push_back((*iter1));rn iter1++;rn rn rn if(iter1!=a.Polynomial_vector.end())rn b.Polynomial_vector.push_back(*iter1++);rn rn if(iter2!=Polynomial_vector.end())rn b.Polynomial_vector.push_back(*iter2++);rn rn rnrnrnbool com(Element e1,Element e2)rn return e1.index
求大佬们帮助
!/bin/bashrn#/usr/sbin/httpd -DFOREGROUND -domain=xiejl.com -httpAddr=:80 &> /dev/null &rnparam=" &> /dev/null &"rnmemsize=`ps -aux | grep "/usr/sbin/httpd -DFOREGROUND" | grep -v grep | awk 'printf $6 '`rnecho $memsizernif [[ $memsize -gt 3080 ]]; thenrn echo "restart begin"rn httpd -DFOREGROUND_restart=`ps -aux | grep "/usr/sbin/httpd -DFOREGROUND" | grep -v grep | awk 'for(i=11;i<=NF;i++)printf $i " "'`rn echo $httpd -DFOREGROUND_restartrn pkill -f /usr/sbin/httpd -DFOREGROUNDrn eval "$httpd -DFOREGROUND_restart $param"rn echo "restart over"rnelif[ -z$memsize ];thenrn echo "start begin"rn eval "/usr/sbin/httpd -DFOREGROUND -domain=xiejl.com -httpAddr=:80 $param"rn echo "start over"rnfirnrn[root@localhost sbin]# bash ehaha.shrn: 没有那个文件或目录bashrn495231083108310831083108rnehaha.sh:行18: 语法错误: 未预期的文件结尾rnrn我用bash执行这个文件的时候就是报这个错 ,一共就17行,然后第18行报错。[img=https://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/001/face/34.gif][/img]rn大佬们帮忙看一下吧rn
看不懂 高分求解答!!!
void CSliceWnd::ScaleImage(BYTE * srcBuf, BYTE * dstBuf, int dstwidth, int dstheight,int scale )rnrn int di,dj,si,sj;rn int srcheight = dstheight / scale;rn int srcwidth = dstwidth /scale;rnrn unsigned char * src, *dst;rnrn for( dj = 0 ; dj < dstheight; dj++)rn rn for( di = 0 ; di < dstwidth; di++)rn rn si = di/scale;rn sj = dj/scale;rnrn src = srcBuf + (sj * srcwidth + si)*3;rn dst = dstBuf + (dj * dstwidth + di)*3;rn rn *dst = *src;rn *(dst+1) = *(src+1);rn *(dst+2) = *(src+2);rn rn rnrn请问这段程序是什么意思啊 ?
运行出现错误,求解答,
代码rn#include rnint main()rnrnrn std::cout<<"五年级一班数学成绩表\n";rn std::cout<<"首先是第一名许凡的成绩:\t"<<100;rn std::cout<
报了一个致命的错误
#rn# A fatal error has been detected by the Java Runtime Environment:rn#rn# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x100a7f17, pid=296, tid=680rn#rn# JRE version: 7.0_05-b05rn# Java VM: Java HotSpot(TM) Client VM (23.1-b03 mixed mode, sharing windows-x86rn)rn# Problematic frame:rn# C [GOOGLEPINYIN2.IME+0xa7f17] DllRegisterServer+0x43d47rn#rn# Failed to write core dump. Minidumps are not enabled by default on client verrnions of Windowsrn#rn# An error report file with more information is saved as:rn# D:\JAVA\lianxi\day22\hs_err_pid296.logrn#rn# If you would like to submit a bug report, please visit:rn# http://bugreport.sun.com/bugreport/crash.jsprn# The crash happened outside the Java Virtual Machine in native code.rn# See problematic frame for where to report the bug.rn#rnrnD:\JAVA\lianxi\day22>
报了一个编码错误??
[code=JScript]rn[color=#0000FF]rn他的编码方式我已经改成utf-8怎么还不对???rnrnjava.lang.Exception: The Category '??????????±?' is not foundrn at cn.igsnrr.escience.geodata.category.CategoryDetails.getInstance(CategoryDetails.java:19)rn at cn.igsnrr.escience.geodata.category.ListCategoryAction.execute(ListCategoryAction.java:34)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:440)rn at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:279)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242)rn at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:163)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:249)rn at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:148)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:93)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:235)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:89)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:128)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept(ProfilingActivationInterceptor.java:104)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:148)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:128)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)rn at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:468)rn at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:395)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:119)rn at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:55)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.struts2.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:102)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)rn at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)rn at java.lang.Thread.run(Thread.java:619)rn[/color]rnrnrn[/code]
一个错误,求解答
要求用定义方法来判断一个数是不是一个素数,以前会编的,好久没编了,今天编出了问题,解决不了,求解答。下面是我编的。请帮忙改改。rnrn public class maintrn rn public static void Main()rn rn int x;rn Console.WriteLine("请输入一个正整数");rn x = int.Parse(Console.ReadLine());rn if (isprime)rnrn Console.WriteLine("不是素数");rn elsern Console.WriteLine("是素数");rn rn rn public class isprimern rn public bool prime(int num)rn rn bool isprime = true;rn for (int i = 2; i < num; i++)rn rn if (num % i == 0)rn return false;rn elsern return true;rn rn rn
学习python遇到的一个小问题,求各位大佬帮忙解答
今天在学习删除列表元素的时候,发现这两种方式结果不一样:n第一种:npets = ['dog','cat','dog','goldfish','cat','rabbit','cat']nprint(pets)nnfor i in pets:n if i == 'dog':n pets.remove(i)nprint(pets)nnwhile 'cat' in pets:n pets.remove('cat')nprint(pets)n输出结果为:n['dog', 'cat', 'dog', 'goldfish', 'cat', 'rabbit', 'cat']n['cat', 'goldfish', 'cat', 'rabbit', 'cat']n['goldfish', 'rabbit']nn第二种是将for循环与while循环置换了一下位置:npets = ['dog','cat','dog','goldfish','cat','rabbit','cat']nprint(pets)nnwhile 'cat' in pets:n pets.remove('cat')nprint(pets)nnfor i in pets:n if i == 'dog':n pets.remove(i)nprint(pets)n输出结果为:n['dog', 'cat', 'dog', 'goldfish', 'cat', 'rabbit', 'cat']n['dog', 'dog', 'goldfish', 'rabbit']n['dog', 'goldfish', 'rabbit']n然而这种情况下,for循环没有将列表中的dog删完,因此感到很困惑。n希望各位大神能帮我解除疑惑。
mysql的一个sql问题求大佬解答
表中字段type 类型 根据类型分组然后每种类型取10条数据 这个sql如何来写
一个discuz的问题,求大佬解答
由于新入并不太了解c币...所以如果成功解决给dalao私包,天色已晚就直插主题好了rn问题由来:由于上次想将dz3.4降到3 2,结果降了一半发现不妥又恢复备份了,导致3 2自rn带的插件新增到现有插件里了,然后今天发现一堆无用的插件便批量删了,结果后台打rn不开了,但根据测试除了打不开后台以外什么都可以用,包括里面的插件,站点一样可rn以打开,下面就上一张登录后台时显示的图,求各位dalao指条明路,要是需要数据库检rn查也可以的。rn[img=https://img-bbs.csdn.net/upload/201803/21/1521568367_551176.jpg][/img]rn然后就是这样的,但作为一个不太懂编程的萌新不知道怎么操作,所以求教。
大佬们,求一个编程怎么打?
编写函数del(char str[])将字符串str中的除头部前导*和后导*以外的*。编写主函数,在主函数中定义字符数组s[80],从键盘输入一字符串给s,通过调用函数del,将字符数组s中的中部的*删除,并输出删除后的字符串, 并输出结果到屏幕上和文件bca5_4.out中。将源程序命名为bca5_4.c。rn测试数据与运行结果】rn第一组 输入:*****a1**2*34EF***G*H******* 输出:**** a1234EFGH*******rn【程序中使用的变量说明】
一个简单的代码看不懂,求解答
[code=C#]rn Console.Write("输入y开始,其他键退出...");rn while (Console.ReadKey().KeyChar == 'y')rn rn Console.WriteLine();rn Console.WriteLine("请输入语句:");rn string input = Console.ReadLine();rn string[] items = input.Split(new string[] " " ,StringSplitOptions.RemoveEmptyEntries);rn Hashtable ht = new Hashtable();rn foreach (string s in items)rn rn ht[s] = (ht[s] == null ? 1 : Convert.ToInt32(ht[s]) + 1);rn rn object[] keys = new ArrayList(ht.Keys).ToArray();rn object[] values = new ArrayList(ht.Values).ToArray();rn Array.Sort(values, keys);rn for (int i = keys.Length - 1; i >= 0; i--)rn rn Console.WriteLine(keys[i].ToString());rn rn Console.Write("输入Y开始,其他键退出...");rn rn[/code]rnrn这是什么意思..rnht[s] = (ht[s] == null ? 1 : Convert.ToInt32(ht[s]) + 1);rnrn这里也不是很懂..rn object[] keys = new ArrayList(ht.Keys).ToArray();rn object[] values = new ArrayList(ht.Values).ToArray();rn Array.Sort(values, keys);rnrn谢谢..rn
字符数组的问题,求大佬解答
#includern#includernrnint main()rnrn const int size =29;rn int i;rn int ret=-1;rn char str[7][size]="sunday","monday","tuesday","wednesday","thursday","friday","saturday";rn char str1[size];rn gets(str1);rn rn 为什么用const定义他会warning,9 2 C:\Users\dell\Documents\未命名2.c [Error] variable-sized object may not be initialized字符串的数组定义没用常量,而用define定义就能编译呢?
求大佬解答,在线等
怎么在html页面动态展示Echarts的数据,求大佬解答[img=https://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/001/face/103.gif][/img]
小白求大佬解答python3
小白用的python3学习,应该是一个很简单的问题,但是自己搞了一天没搞定,就是这个script让unicode,然后网上找了一大堆办法,把它decode了,又报错说“utf-8 codec cant decode byte 0xb4...”,然后又decode('gbk'),也是“gbk codec cant decode byte…”。这个script明明是byte编码啊,为什么解码就不行了啊。实在找不到办法到这儿来求助各位大佬了。求不要让小白从入门到放弃啊[img=https://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/003/monkey/11.gif][/img][img=https://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/003/monkey/11.gif][/img][img=https://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/003/monkey/11.gif][/img][img=https://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/003/monkey/11.gif][/img][img=https://img-bbs.csdn.net/upload/201903/28/1553774088_306505.jpg][/img][img=https://img-bbs.csdn.net/upload/201903/28/1553774088_743672.jpg][/img][img=https://img-bbs.csdn.net/upload/201903/28/1553774089_656066.jpg][/img][img=https://img-bbs.csdn.net/upload/201903/28/1553774090_166086.jpg][/img][img=https://img-bbs.csdn.net/upload/201903/28/1553774087_981974.jpg][/img][img=https://img-bbs.csdn.net/upload/201903/28/1553774091_507633.jpg][/img][img=https://img-bbs.csdn.net/upload/201903/28/1553774101_792468.jpg][/img][img=https://img-bbs.csdn.net/upload/201903/28/1553774102_645963.jpg][/img][img=https://img-bbs.csdn.net/upload/201903/28/1553774103_398201.jpg][/img][img=https://img-bbs.csdn.net/upload/201903/28/1553774106_678246.jpg][/img][img=https://img-bbs.csdn.net/upload/201903/28/1553774104_614216.jpg][/img][img=https://img-bbs.csdn.net/upload/201903/28/1553774107_872860.jpg][/img]
AttributeError问题 求大佬解答
[img=https://img-bbs.csdn.net/upload/201801/09/1515429817_447527.png][/img]rnrn[code=python]from django.db import modelsrnrnclass Topic(models.Model):rn """用户学习的主题"""rn text = models.CharField(max_length=200)rn date_added = models.DataTimeField(auto_now_add=True)rnrn def _str_(self):rn '''返回模型的字符串表示'''rn return self.text[/code]rn rn脚本很简单 实在是不知道怎么出错了 就是运行不下去 求大佬解答啊
求各位汇编大佬解答
[img=https://img-bbs.csdn.net/upload/201707/09/1499569464_551914.jpg][/img]小白今年刚学汇编,用的书是《intel汇编程序设计》书中提供了irvine32.inc、irvine32.lib。据C语言的学习知道,.inc文件相当于.h文件,不链接静态库是没有任何用的,于是我用link.exe 链接了2.obj,irvine32.lib,结果就发生了如图所示的错误,我也不知道为什么,文件夹权限也改了,甚至DOSbox都用管理员权限运行,然而并没有什么用,不太懂怎么回事,求大佬解答。rn
求 大佬 解答 EXE停止工作
代码如下n#include n#include nint main()nnFILE* fi = fopen("1","r");n if (fi = NULL)n printf("失败");n return 1;n n char name[20];n int age;n double weight;n fscanf(fi, "%s", name);n fscanf(fi, "%d %lf", &age, &weight);n fclose(fi);n printf("%s %d %g\n", name, age, weight);n getchar();n return 0;n
数据库范式问题求大佬解答!!!
1:关系模型R={A、B、C、D、E、G}其上存在函数依赖集F={BC->D,CD->AE,AG->CE,AB->GE}rna:证明BC为候选键。rnrnb:将R分解为R1=(ACDE),R2=(BCDG),请问R2是否满足BCNF?rnrnc:对于上面的分解,测试AG->ce,这个函数依赖是否被保持?rnrnd:请将R分解,是分解后的所有模式Rd至少满足3NF?rnrne:将R分解,是分解后的所有Rd满足BCNF?
mysql小问题,求大佬解答
select *nfrom (select id, sum(degree)nfrom employee_skill ngroup by idn)as t1 full outer joinn(select id, sum(score)nfrom project_employeengroup by idn)as t2nwhere t1.id = t2.idnnn这段 sql 语句 不知道为什么 不能使用 全外连接,如果是内连接的话,语句是没有问题的n希望大佬能解答一下
求一个批处理文件,求~~
怎么写都不对了rn我想用osql执行sql文件导入数据rn因为文件很多,大概有一百多个rn我想在执行完毕一个以后自动执行下一个rnbat批处理文件怎么写啊?rn
c#问题 求大佬解答
用c#窗口怎么做要求输入的数组在一个text.box里面实现输入若干个正整数,以-1结束,找出其中的最大值,并求出它们的平均值。
求前端大佬们推荐书籍
本是做后端的,跳槽去新的公司要求做一段时间前端。rnrn本人的前端经历是,一年前手写过几个站的前端,包括css,div,js,但现在都忘光了,基础知识还是记得的,但还有很多不足,比如具体设计一个基于1-2-1的页面,里面涉及很多div嵌套技巧,希望大神们给小弟推荐一些div进阶的书,谢谢!
大佬们求帮助啊
pta上做的老师布置的一道题,总是有俩测试点不过,还不知道是怎么不对,,我试过我能想到的所有情况,都是对的。。。。rn题目:就是一个大整数求和的题,定义一个大整数类,重载+运算符什么的rn[img=https://img-bbs.csdn.net/upload/201804/29/1525001688_893572.png][/img]rnrn下面是我的完整代码 真心不知道那个地方不对。。ππrn[img=https://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/003/onion/1.gif][/img]rn=============================================================rn#include rn#include rn#include rn#includern#includernusing namespace std;rnrnrnclass BigIntrn char num[200];rn friend istream& operator>>(istream &input,const BigInt &bi);rn friend ostream& operator<<(ostream &output,const BigInt &bi);rnpublic:rn BigInt()memset(num,'a',200);rn BigInt operator + (const BigInt N)rn rn BigInt temp;rn int a[200]=0;rn int l1=strlen(N.num),l2=strlen(num);rn int l=l1-1;rn int sum=0;rn for(int i=0;i9)rn sum=a[i]/10;rn a[i]=a[i]%10;rn rn rn int j=0;rn l=1+max(l1,l2);rn if(a[l-1])rn for(int i=l-1;i>=0;i--,j++)rn temp.num[j]=a[i]+'0';rn temp.num[l]='\0';rn rn elsern j=0;rn for(int i=l-2;i>=0;i--,j++)rn temp.num[j]=a[i]+'0';rn temp.num[l-1]='\0';rn rn return temp;rn rn friend ostream& operator<<(ostream& out,const BigInt& N)rn rn int i=0;rn while(1)rn if(N.num[i]!='0') rn break;rn rn i++;rn rn if(N.num[i]=='\0') rn out<<"0";rn return out;rn rn while(N.num[i]!='\0')rn rn out<>(istream& in,BigInt& N)rn rn in>>N.num;rn return in;rn rn; rnint main()rn while(1)rn BigInt a, b, c;rn cin>>a>>b;rn c=a+b;rn cout<
大佬们,求一串代码
我现在有 此处省略5000字符标签,高度不固定。rn求代码rn当 高度低于100px的时候,不做修改,当高度超过100px的时候,给pre赋值style="max-height:100px;overflow:hidden;",并在pre的底部显示“显示全部内容”,点击文字钮就把style="max-height:100px;overflow:hidden;"移除,这样就能显示 全部的内容。rn总结来说,就是我pre内容如果太多,超过了100px高度,就把per设置最大高度max-height:100px;并禁止滚动条,此时点击“阅读全部”文字,则移除style,并隐藏“阅读全部”这几个字rnrn有没有哪个老铁有现成的案例或者代码,先行谢过。
大佬们求个正则
字符串是类似“班级数-(46人至50人班级数+51人至55人班级数)”,其他的我在代码里加了点注释rn[code=csharp]rnvar formulas = Regex.Split(model.Formula, ValidationRule.FormulaRegex); //取出“班级数”,“46人至50人班级数”,“51人至55人班级数”组成的数组rnstring temp = model.Formula;rnforeach (var name in formulas)rnrn if (string.IsNullOrWhiteSpace(name))rn rn continue;rn rn ReportItem ri = model.ReportItems.SingleOrDefault(s => s.Name == name);rn if (ri == null)rn rn continue;rn rn temp = Regex.Replace(temp, $"\bname\b", ri.ShortName); //用另一个字符串替换当前的变量rn[/code]rnrn\b只能匹配单词的边界,中文边界匹配不了,求个正则匹配这种中文词语变量。。rn
Axis2奇怪错误,求大虾们解答
我用Axis2生成客户端的时候出现了这样的错误,弄了两天都没有解决,请各位朋友帮忙看看,错误如下:rnrnorg.apache.axis2.AxisFault: org.apache.axis2.databinding.ADBException: Unexpected subelement r1_Codern at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)rn at org.example.www.yeepayinterface.YeepayInterfaceStub.fromOM(YeepayInterfaceStub.java:26414)rn at org.example.www.yeepayinterface.YeepayInterfaceStub.RegistMerchant(YeepayInterfaceStub.java:1612)rn at org.feirui.test.Test.main(Test.java:34)rnCaused by: java.lang.Exception: org.apache.axis2.databinding.ADBException: Unexpected subelement r1_Codern at org.example.www.yeepayinterface.YeepayInterfaceStub$RegistMerchantResponse$Factory.parse(YeepayInterfaceStub.java:11434)rn at org.example.www.yeepayinterface.YeepayInterfaceStub.fromOM(YeepayInterfaceStub.java:26366)rn ... 2 morernCaused by: org.apache.axis2.databinding.ADBException: Unexpected subelement r1_Codern at org.example.www.yeepayinterface.YeepayInterfaceStub$RegistMerchantResponse$Factory.parse(YeepayInterfaceStub.java:11325)rn ... 3 morern
看不懂的指针,求大神解答
[img=https://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/003/onion/3.gif][/img]rn 如下 flashi_nor_device * (*probe_fcn) (volatile word *probe_addr);这到底是什么意思?指针套着指针
关于EF框架和三层架构的问题,求大佬们解答
我之前学的是WEBfrom和三层架构,最近接触了MVC的EF框架,我看网上说可以EF和三层一起用,那么问题来了,EF框架主要是进行数据访问,而三层中的DAL数据层也是数据访问,这样会不会显得EF或者DAL层其中一个很多余,谢谢各位大佬解答
运行python的批处理文件de书写
当我们运行python时,也可以写一个批处理。在windows上:1.建立一个后缀为.bat的文件2.用记事本打开这个文件3.将下面的内容写入文件内并保存  @echo off  title [文件]:%~0  cd 文件路径  python  xxx.py4.双击.bat文件,就可以运行python了...
npm start报了一个错误
运行express项目遇到的问题 今天新建了一个express项目,运行npm start时,报了一个错误是这样的。 Failed to load c++ bson extension, using pure JS version express-session deprecated undefined resave option; provide resave option app.js:27:...
程序报了一个奇怪的错误
Exception in thread "Timer-11" java.lang.NullPointerExceptionrn at com.mchange.v2.log.log4j.Log4jMLog$Log4jMLogger.isLoggable(Log4jMLog.java:257)rn at com.mchange.v2.resourcepool.BasicResourcePool$CullTask.run(BasicResourcePool.java:1934)rn at java.util.TimerThread.mainLoop(Timer.java:512)rn at java.util.TimerThread.run(Timer.java:462)rnException in thread "Timer-12" java.lang.NullPointerExceptionrn at com.mchange.v2.log.log4j.Log4jMLog$Log4jMLogger.isLoggable(Log4jMLog.java:257)rn at com.mchange.v2.resourcepool.BasicResourcePool$CullTask.run(BasicResourcePool.java:1934)rn at java.util.TimerThread.mainLoop(Timer.java:512)rn at java.util.TimerThread.run(Timer.java:462)rnException in thread "Timer-13" java.lang.NullPointerExceptionrn at com.mchange.v2.log.log4j.Log4jMLog$Log4jMLogger.isLoggable(Log4jMLog.java:257)rn at com.mchange.v2.resourcepool.BasicResourcePool$CullTask.run(BasicResourcePool.java:1934)rn at java.util.TimerThread.mainLoop(Timer.java:512)rn at java.util.TimerThread.run(Timer.java:462)rnException in thread "Timer-14" java.lang.NullPointerExceptionrn at com.mchange.v2.log.log4j.Log4jMLog$Log4jMLogger.isLoggable(Log4jMLog.java:257)rn at com.mchange.v2.resourcepool.BasicResourcePool$CullTask.run(BasicResourcePool.java:1934)rn at java.util.TimerThread.mainLoop(Timer.java:512)rn at java.util.TimerThread.run(Timer.java:462)rnException in thread "Timer-15" java.lang.NullPointerExceptionrn at com.mchange.v2.log.log4j.Log4jMLog$Log4jMLogger.isLoggable(Log4jMLog.java:257)rn at com.mchange.v2.resourcepool.BasicResourcePool$CullTask.run(BasicResourcePool.java:1934)rn at java.util.TimerThread.mainLoop(Timer.java:512)rn at java.util.TimerThread.run(Timer.java:462)rnException in thread "Timer-16" java.lang.NullPointerExceptionrn at com.mchange.v2.log.log4j.Log4jMLog$Log4jMLogger.isLoggable(Log4jMLog.java:257)rn at com.mchange.v2.resourcepool.BasicResourcePool$CullTask.run(BasicResourcePool.java:1934)rn at java.util.TimerThread.mainLoop(Timer.java:512)rn at java.util.TimerThread.run(Timer.java:462)rnException in thread "Timer-17" java.lang.NullPointerExceptionrn at com.mchange.v2.log.log4j.Log4jMLog$Log4jMLogger.isLoggable(Log4jMLog.java:257)rn at com.mchange.v2.resourcepool.BasicResourcePool$CullTask.run(BasicResourcePool.java:1934)rn at java.util.TimerThread.mainLoop(Timer.java:512)rn at java.util.TimerThread.run(Timer.java:462)
大佬们
子类对象能直接向其父类赋值,父类对象不能向其子类赋值。如何理解这句话呀[face]monkey:2.gif[/face]
相关热词 c#串口测试应用程序 c# 匹配 正则表达式 c#防止窗体重绘 c#读写txt文件 c#挖地雷源代码 c#弹框选项 c# 移除 队列 c# 密码写入配置文件 c# 获取可用内存大小 c# 嵌入excel编辑