那我直接发你邮箱吧
9 def power_difference_op(input_x, input_y, input_pow): 10 with tf.compat.v1.Session() as sess: 11 def powerD(in1,in2,pow): 12 input1 = tf.placeholder(in1) 13 input2 = tf.placeholder(in2) 14 poww = tf.placeholder(pow) 15 z=tf.powerDifference(input1,input2,poww) 16 out = tf.power_difference(input_x, input_y, input_pow, None) 17 return sess.run(z, feed_dict={input1:in1,input2:in2, poww:pow, output:out}) 报错AttributeError: 'module' object has no attribute 'powerDifference' 大佬啊,你知道这些是之前学了什么课程 啊展开
我的意思是那个框架集成测试的代码
单算子当初没有测试,这是主要计算部分 for (int i = 0; i < quotient;i++) { // TODO:拷入操作 __memcpy(input1_nram,input1+i*256,256*sizeof(uint16_t),GDRAM2NRAM); __memcpy(input2_nram,input1+i*256,256*sizeof(uint16_t),GDRAM2NRAM); // TODO:实际计算部分 __bang_sub(input1_nram,input1_nram,input2_nram,256); for(int j=0;j<=pow;j++) { __bang_mul(input1_nram,input1_nram,input1_nram,256); } // TODO:结果拷出操作 __memcpy(output+i*256,input1_nram,256*sizeof(uint16_t),NRAM2GDRAM); } 还有第一个实验框架测试,没有计算图, out = tf.power_difference(input_x, input_y, input_pow, None) return sess.run(z, feed_dict={:out}) 这个z是怎么来的?还有这个out传给谁呢展开
单算子测试了么? 是用的sess.run(out,feed={})的格式么?
83 pow_tensor = sess.graph.get_tensor_by_name('moments_15/PowerDifference_z:0') 84 input_tensor = sess.graph.get_tensor_by_name('X_content:0') 85 output_tensor = sess.graph.get_tensor_by_name('add_37:0') 86 start_time = time.time() 87 ret =sess.run(output_tensor, feed_dict={input_tensor:[X],pow_tensor:2}) 大佬看看这个哪里写错了,报错tensorflow.python.framework.errors_impl.UnknownError: CNRT_RET_ERR_STREAM [[{{node my_mlu_op_0}}]]展开
参考run_ori_pb(),先获取节点张量pow_tensor = sess.graph.get_tensor_by_name('moments_15/PowerDifference_z:0'),然后sess.run的时候在feed_dict参数传递pow_tensor:2展开
请登录后评论