- 博客(163)
- 收藏
- 关注
转载 sbatch error: batch script contains dos line breaks
sbatch error: batch script contains dos line breaks
2022-07-28 01:23:00
1158
原创 docker: The connection to the server was reset while the page was loading.
After changingthe command from docker run -p 3000:3000app to docker run -p 8080:8080 app, I can finally open this webpage on my local computer.The possible reason is "The 'listening on 8080' is a message coming from the container. It is listening on ..
2022-02-01 05:04:55
2066
转载 Postgresql:could not connect to server: Connection refused Is the server running on host “lo
On windows, Just go to the 'Services'. Start/Restart the postgresql-X64 service. It worked for me as my service was in a stopped state somehow.
2021-10-28 04:59:32
1634
原创 Taberror inconsistent use of tabs and spaces in indentation
pip install autopep8then, autopep8 -i my_file.py
2021-10-06 11:32:36
190
原创 scipy.misc module has no attribute imread
imread is deprecated in scipy.misc; use imageio.imread instead.imageio provides the same functionality as Scipy. But keep in mind that some arguments need to be changed (for detailed information please checkhere):Instead ofmode, use thepilmodekeywo...
2021-10-05 02:51:32
202
原创 tensorflow==2.0, module ‘tensorflow._api.v2.train‘ has no attribute ‘NewCheckpointReader‘
Use tf.compat.v1.train.NewCheckpointReader and it works.
2021-10-04 23:43:44
660
转载 userwarning : h5py is running against HDF5 1.10.5 when it was built against 1.10.4, this may cause
C:\Users\marietto2020\Desktop\MMD\OpenMMD\OpenMMD 1.0\3d-pose-baseline-vmd(tensorflow) λ openposeto3d´╗┐es (40 sloc) 1.62 KB"´╗┐es" is not recognized as an internal or external command or as a batch file.Please input the path of result from OpenPose .
2021-10-04 23:35:33
2084
转载 keras-vis InvalidArgumentError: input_1_2:0 is both fed and fetched.
pip install git+https://github.com/raghakot/keras-vis.gitInvalidArgumentError: input_1_2:0 is both fed and fetched. · Issue #127 · raghakot/keras-vis · GitHub
2021-10-02 11:56:35
686
原创 Error: cannot import name ‘imresize‘ error while this function importing from scipy.misc
install scipy 1.1.0 by :pip install scipy==1.1.0
2021-10-02 11:25:28
211
原创 terminate called after throwing an instance of ‘std::bad_alloc
The error implies that your running out memory.
2021-09-22 11:39:28
621
原创 TypeError: __init__() got an unexpected keyword argument ‘name‘
When I wrote a custom class of Keras, I met this error.Solution:change from the snippetbelow class custconv2d(keras.layers.Layer): def __init__(self): super(custconv2d, self).__init__() self.k = self.add_weight(shape=(1, ), in...
2021-09-17 10:10:53
2401
原创 attributeerror: ‘str‘ object has no attribute ‘decode‘ keras mode.load_weights
Solution: downgrading theh5pypackage (in my case to 2.10.0), apparently putting back only Keras (2.3.1) and Tensorflow (1.15) to the correct versions was not enough.
2021-09-09 10:29:44
213
原创 HDMI 连接笔记本与显示器
Step 1. 最重要的一点就是在笔记本与显示器同时关机的状态下用HDMI cable连接Step 2. 连接好了打开两台机器Step 3. 显示器上有一个menu,选择 HDMI channelStep 4. 笔记本win10,设置里面搜索投影设置,然后会跳出来四个选项,根据所需选择,一般选择仅第二屏幕即可。最后就可以看到笔记本上的画面在显示器上出现,笔记本电脑黑屏。...
2021-07-13 04:24:12
11744
原创 ‘numpy.ndarray‘ object has no attribute ‘convert‘
First convert it to image object byImage.fromarraythen useconvert
2021-05-31 18:31:42
9300
1
原创 Cannot open C:\.xxxx\Anaconda3\envs\gan\Scripts\tensorboard-script.py
My tesorflow is1.15, tensorboard is 2.0. This may be caused by version incompatible.solution: unistalltensorboard 2.0, and installtensorboard 1.15then runtensorboard --logdir you/log/dir/path
2021-04-10 19:27:20
369
转载 Append new row to old csv file python
You can use the code below to add a new row to an existent csv file.with open('document.csv','a', newline='') as csvfile: fieldnames = ['fold', 'accuracy','precision', 'recall', 'f1'] writer = csv.DictWriter(csvfile, fieldnames=fieldnames) .
2021-03-18 21:28:43
169
原创 UnicodeDecodeError: ‘ascii‘ codec can‘t decode byte 0xf2 in position 4: ordinal not in range(128)
I am trying to use the WESAD dataset, however, the programthrows an error when I read the .pkl data.p='WESAD/S9/S9.pkl'with open(p, 'rb') as f: s9_data = pickle.load(f)Solution:p='WESAD/S9/S9.pkl'with open(p, 'rb') as f: s9_data = pickle.
2021-02-28 16:32:13
259
原创 valueerror: cannot set tensor: got tensor of type notype but expected type float32 for input 1, name
Error:valueerror: cannot set tensor: got tensor of type notype but expected type float32 for input 1, name: input_2Solution:When using cv2.imread(/your/image/path) to read an image, the data type is Uint8, you need to change it to float32.under_exp.
2020-12-26 11:54:58
2357
1
原创 AttributeError: type object ‘TFLiteConverterV2‘ has no attribute ‘from_keras_model_file‘
Solution:After loading a keras model instance, you can use "tf.lite.TFLiteConverter.from_keras_model"to replace "from_keras_model_file".from tensorflow import kerasmodel = keras.models.load_model('path/to/location')converter = tf.lite.TFLiteConver.
2020-12-25 15:54:04
2139
原创 Create virtual environments for python with conda
1.Create a virtual environment for your project.conda create -n yourenvname python=x.xe.g. conda create -n tensorflow2.0 python=3.72.Activate your virtual environment.source/conda activate yourenvnamee.g. conda activate tensorflow2.03.I...
2020-12-25 15:45:30
374
原创 anaconda UnavailableInvalidChannel: The channel is not accessible or is invalid.
Solution: Restore the default source using the following command.conda config --remove-key channels
2020-12-25 15:33:00
532
原创 Python 3.6 urllib has no attribute request
Reference:https://stackoverflow.com/questions/37042152/python-3-5-1-urllib-has-no-attribute-requestYou have to use the following:import urllib.requestThe reason is:With packages, like this, you sometimes need to explicitly import the piece you w
2020-12-02 21:30:34
166
原创 Find the maximum and minimum value in tensor array
[[2,1],[-1,0]]tf.reduce_min(ldrc)ouput:-1tf.reduce_max(ldrc)ouput:2
2020-11-05 20:56:14
190
原创 AttributeError: ‘UpSampling2D‘ object has no attribute ‘op‘
x = layers.UpSampling2D(size=(2, 2)) x = layers.UpSampling2D(size=(2, 2)) x = layers.UpSampling2D(size=(2, 2)) x = layers.UpSampling2D(size=(2, 2)) x = layers.UpSampling2D(size=(2, 2))Solution:忘记把书籍传进去了。x = layers.UpSampling2D(size=(2, 2))...
2020-11-02 09:48:38
440
原创 IndentationError and TabError
IndentationError:Reason: Although it seems that these lines are aligned, actually it is not for python.Solution: Delete the space before the 3 lines (plt.show(), for fmap,feature_maps = ), then press tab to align.TabError:As you can see, I e...
2020-10-31 18:45:07
110
转载 Unable to load vgg16 weights
https://github.com/keras-team/keras/issues/8998generate=vgg16.VGG16(include_top=False,weights='imagenet',input_tensor=y_pre,input_shape=(None,None,3))Error:ValueError: You are trying to load a weight file containing 13 layers into a model with 18 lay.
2020-10-29 20:43:04
381
原创 imread and imwrite cause differences in image pixels via opencv
Question: read an image ev and then save it as ev_cp. Finally, read the saved image ev_cp. Intuitively,ev_cp should have the same value asev pixel by pixel, but the blew code does not think so. It indicates that the savedev_cp imagehassome values(pixe...
2020-10-28 10:14:42
94
原创 Imageio.imsave saves image correctly but cv2.imwrite saved thes ame image as black
imageio.imwrite('testout.jpg', np.squeeze(ldr))cv2.imwrite('testout.jpg', np.squeeze(ldr))Result:imageio:cv2:Solution:You need to multiply it by 255 to get the correct range.cv2.imwrite('testout.jpg', np.squeeze(ldr)*255.0)
2020-10-27 00:48:25
508
原创 tensorflow.python.framework.errors_impl.DataLossError: truncated record at 40109222 [Op:IteratorGetN
it is main due to the incomplete data.
2020-10-25 08:43:23
1635
转载 What does if __name__ == “__main__”: do?
转:https://stackoverflow.com/questions/419163/what-does-if-name-main-do这个回答写的简单易懂,转出来分享一下~~(^_._^)~~Whenever the Python interpreter reads a source file, it does two things: it sets a few special variables like__name__, and then it executes all .
2020-10-24 09:19:06
209
原创 RuntimeError: tf.summary.FileWriter is not compatible with eager execution. Use tf.contrib.summary
Here is my code:tf.enable_eager_execution()writer = tf.summary.FileWriter(result_path+'logs/')for epoch in range(epochs): if step_count % 100 == 0: ref = tf.summary.image("G_ref/{}".format(step_count), image_batch, max_outputs=12).
2020-10-23 17:57:15
2853
转载 keras source codes: how to reach?
转https://stackoverflow.com/questions/52249488/keras-source-codes-how-to-reachThere is way to get the source code which might be useful especially if you are not using the latest version (available on github).You can always find the keras source code d.
2020-10-23 17:33:31
106
转载 Python SyntaxError: non-default argument follows default argument Solution
转载https://careerkarma.com/blog/python-syntaxerror-non-default-argument-follows-default-argument/#:~:text=The%20Python%20%E2%80%9CSyntaxError%3A%20non%2D,come%20after%20non%2Ddefault%20arguments.An argument can have a default value in a Python function. .
2020-10-23 09:32:48
903
原创 Reference Cite style 【Texmaker】
When citing references, thebibliography style of your articledisplays the name of authors of the references, instead [1,2,3].How do we deal with this situation?1. \citep (include authors' name in parentheses; used as supplementary)(1) 2 authors....
2020-10-22 15:30:52
246
原创 Latex [! Undefined control sequence.<recently read> \botrule \midrule \toprule]
```\midrule```is a command defined by theBooktabspackage. Include ```\usepackage{booktabs}```in your preamble to typeset your table.For the ```\botrule```
2020-10-22 07:08:50
5264
4
转载 TensorFlow dataset.__iter__() is only supported when eager execution is enabled
def parse_function(filename, filename2): image = read_image(fn) def ret1(): return image, read_image(fn2), 0 def ret2(): return image, preprocess(image), 1 return tf.case({tf.less(tf.random.uniform([1])[0], tf.constant(0.5)): ret2}, defaul.
2020-10-21 17:13:21
4651
7
转载 how does tf.keras.layers.conv2d with padding=‘same‘ and strides=1 behave
import tensorflow as tfinputs = tf.random_normal([1, 64, 64, 3])print(inputs.shape)conv = tf.keras.layers.Conv2D(6, 4, strides=2, padding='same')outputs = conv(inputs)print(outputs.shape)produces(1, 64, 64, 3)(1, 32, 32, 6)Explanation:K..
2020-10-21 08:53:42
258
原创 AttributeError: ‘Node‘ object has no attribute ‘output_masks‘
import kerasfrom keras.layers.normalization import BatchNormalizationimport tensorflow as tfx = tf.keras.layers.Conv2D(16, kernal, activation='relu', padding='same')(x)x = BatchNormalization()(x)这是因为我既用了Keras里面的BatchNormalization, 又用了tf.keras里..
2020-10-20 10:58:46
392
原创 Error : Failed to get convolution algorithm. This is probably because cuDNN failed to initialize
Error : Failed to get convolution algorithm. This is probably because cuDNN failed to initialize, so try looking to see if a warning log message was printed above.Method1:可能是cudnn,cuda,tensorflow等版本不兼容的问题。Method2:在 import tensorflow as tf 语句的..
2020-10-12 19:41:29
171
原创 anaconda-navigator: cannot open Qpa.so.5: undefined symbol: FT_Get_Font_Format Ubuntu
本来想通过anaconda-navigator的图形界面里面的虚拟环境来安装TensorFlow-GPU,但是在terminal输入anaconda-navigator之后报错如标题,不行之后就换了个方法,直接activate激活虚拟环境然后 pip install tensorflow-gpu安装,但是也报错误 network error啥的,郁闷。最后尝试用 conda installtensorflow-gpu成功了,刚刚开始用anaconda,不知道为什么会出现这种情况,希望各位大佬指点一下,感谢.
2020-10-12 18:07:03
328
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人