Value passed to parameter ‘shape’ has DataType float32 not in list of allowed values: int32, int64
这句话的意思是说,你那行代码要求是是整数类型的,但是你里面有浮点型,例如
w = weight_variable([1,1,channel_out,channel_out/ratio])
上面中channel_out/ratio是浮点型,所以改成
w = weight_variable([1,1,channel_out,int(channel_out/ratio)])
程序就可以运行啦。