- 博客(20)
- 资源 (4)
- 收藏
- 关注
原创 tensorboard --logdir=‘logs‘网页不显示
tensorboard --logdir='logs'网页中不显示改为:tensorboard --logdir logs
2022-01-06 15:20:43
947
原创 module ‘tensorflow.compat.v1.train‘ has no attribute ‘SummaryWriter‘
writer = tf.train.SummaryWriter("logs/", sess.graph)报错: module 'tensorflow.compat.v1.train' has no attribute 'SummaryWriter'改为:writer = tf.summary.FileWriter("logs/", sess.graph)
2022-01-06 15:18:46
1009
原创 `loss` passed to Optimizer.compute_gradients should be a function when eager execution is enabled.
loss = tf.reduce_mean(tf.square(y - y_data))出错:`loss` passed to Optimizer.compute_gradients should be a function when eager execution is enabled.错误原因:Tensorflow 版本问题在Tensorflow 2.0 中,eager execution 是默认开启的。需要先关闭eager execution,在代码前加入tf.disa..
2022-01-04 11:00:09
1903
原创 module ‘tensorflow‘ has no attribute ‘set_random_seed‘
将tf.set_random_seed(1)替换为tf.random.set_seed(1)
2021-12-22 17:47:41
5420
1
原创 module ‘tensorflow‘ has no attribute ‘placeholder‘
tensorflow 2以后的版本没有 'placeholder'将import tensorflow as tf,替换为import tensorflow.compat.v1 as tftf.disable_v2_behavior()
2021-12-22 17:46:17
213
原创 reduction operation ‘argmax‘ not allowed for this dtype
使用python3时,将argmax()改为idxmax()仍然报错:reduction operation 'argmax' not allowed for this dtype在idxmax前加.astype('float64'):.astype('float64').idxmax()
2021-12-21 17:04:52
692
原创 DataFrame‘ object has no attribute ‘ix‘
‘------T’ 这个例子debug1. DataFrame' object has no attribute 'ix'将 ix 改为 loc2. 跑一轮报一堆错将 argmax 改为 idxmax
2021-12-21 15:49:21
466
原创 《深入浅出强化学习编程实战》鸳鸯系统(值迭代)
import randomimport timefrom testyuanyang import YuanYangEnvclass DP_Value_Iter: def __init__(self,yuanyang): self.states=yuanyang.states self.actions=yuanyang.actions self.v=[0.0 for i in range(len(self.states)+1)] .
2021-11-03 16:57:44
264
原创 pip install sklearn出错
ERROR: Could not find a version that satisfies the requirement sklearnc (from versions: none)ERROR: No matching distribution found for sklearnc如果是pip版本太老,则更新pip执行:pip install --upgrade pip如果升级还报错:执行:pip3 insatll sklearn试试...
2021-11-03 16:22:32
1136
原创 《深入浅出强化学习编程实战》鸳鸯系统(策略迭代)
import randomimport timefrom testyuanyang import YuanYangEnvclass DP_Policy_Iter: def __init__(self,yuanyang): self.states=yuanyang.states self.actions=yuanyang.actions self.v=[0.0 for i in range(len(self.states)+1)] .
2021-11-02 21:04:38
336
原创 matlab2021a安装包
链接:https://pan.baidu.com/s/1mOkBAF7vryBvDV1U9vEwnQ提取码:98ai
2021-11-02 14:31:10
2183
2
原创 直流电机调速伺服控制(最优控制)
直流电机调速伺服控制实验内容:基于pid的直流电机调速伺服控制 基于模糊控制的直流电机调速伺服控制 基于bp神经网络的直流电机调速伺服控制题目介绍:直流电机等效电路图其中控制量是直流电机的驱动电压,是电机的电枢电阻,是电机的电枢电流,是电机扭矩系数(km*w反电动势),是电机电枢电感。忽略系统摩擦力,与惯性轮固连的电机转子运动学方程如下:其中是转子的等效惯量,是惯性载荷的等效惯量。此时可得如下电机系统状态方程其中输出测量量为电机转子的角速度。状态方程等.
2021-11-02 14:19:43
1249
原创 线性系统——一级倒立摆系统的控制
研究背景 倒立摆作为一种典型的控制系统,具有良好的测试性能评估不同的控制方法。其中的基本原理控制系统可以在许多工业应用中找到,如稳定控制行走机器人、航天飞机发射平台振动控制等。问题概述 考虑一个具有一个自由度的一级倒立摆系统如下图所示。系上细杆的小车能在外力的作用下沿平滑的轨道移动,需要设计一个控制器,使其能够控制滑轨一级倒立摆可以在其垂直位置经过干扰后维持稳定。对于这个例子,我们假设: M 小车质...
2021-11-02 13:55:52
2659
原创 《深入浅出强化学习编程实战》鸳鸯系统代码+详细注释
https://download.csdn.net/download/weixin_38594096/36407777https://download.csdn.net/download/weixin_38594096/36407777仅靠书中的代码是不能运行的,会提示无法load_bird_male()需要下载上面链接中的文件,才可以,里面包括源码+resource(图片文件)+load.pyimport pygamefrom load import *import mathimport
2021-11-02 11:28:05
3118
原创 pycharm 安装swig
直接用pip install swig报错了,看了很多人说执行这个:conda install swig就可以,但是使用pycharm的话注意要先将setting——python interpreter中改成这样:然后关掉,重新打开,再输入conda install swig就成功了!查看版本swig -version...
2021-10-29 17:04:36
912
1
原创 BP神经网络python程序
from numpy import *def num(): number = input("请输入初始值: ") w=zeros(8) b=zeros(2) for i in range(0,10): if i==0 or i==1 or i==2 or i==3: if int(number[i])%2 == 0: w[i]=int(number[i])*0.1 else: w[i] =int(number[i]) * 0.1+0.05 elif i==4:.
2021-10-29 13:52:21
278
原创 更新pip时,明明安装了pip,却提示No module named ‘pip‘
在更新pip时,明明安装了pip,却提示No module named 'pip'提示可以:pip install --user“name”还是不行!!然后发现一个帖子的办法不错先执行python -m ensurepip 然后执行python -m pip install --upgrade pip 即可更新完毕。不过也可能因为,我重启了一下pycharm原帖:解决 ModuleNotFoundError: No module named 'pip'_wuyepiao...
2021-10-29 11:21:24
384
原创 anacoda3-2021.5(Win11)安装教程
官网下载地址:Anaconda | Individual Edition进入网页后如下图所示:下拉找到下载安装包的位置,选择需要的版本:下载好后如图所示:双击进行安装,点击Next:点击 I agree:选择All users(如果电脑中只有一个user,选择just me 也可):设置安装位置:第一个不勾选,则需要手动添加环境变量(见后文):安装成功:配置环境变量:在此电脑——右键——属性点...
2021-10-27 09:49:59
1040
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人