Tag Archives: notes

Tensorflow UnknownError (see above for traceback): Failed to get convolution algorithm. This is pro

The environment configuration is Ubuntu 16.04, tensorflow 1.13.1, cuda10, cudnn7.6.4.
Error when running tensorflow code
UnknownError (see above for traceback): 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.
With the tensorflow, cuda, and cudnn versions corresponding correctly, add the following code to the code.

import os
os.environ['CUDA_VISIBLE_DEVICES'] = "0"

config = tf.ConfigProto()
config.allow_soft_placement=True # If the device you specify does not exist, allow TF to allocate the device automatically
config.gpu_options.per_process_gpu_memory_fraction = 0.9 #Allocate a portion of the video memory to the program to avoid memory overflow
config.gpu_options.allow_growth = True #Allocate video memory on demand

with tf.Session(config=config) as sess:
	#Your Codes

Modify grub to solve computer startup error: error 17

Modify grub to solve computer startup error: error 17

The original computer has C, D, e, F, G. C disk, windows system disk and G disk are installed with CentOS. Later, due to the need to compress the volume of the way from the D disk compressed out of an H disk. Then when I started the computer again, I encountered an error: error 17

The reason:
is that windows is installed first and then Linux is installed. In this way, grub is booted by CentOS on disk g. now a new logical partition is divided before the partition, which causes the disk system symbol to move backward by one bit. Therefore, grub fails.
Solution:
1, burn a Linux Installation U disk, enter BIOS, modify boot items, and boot from U disk.
2. I use RedHat 7.0. After the U disk is started, enter the troubleshooting option, and then enter the rescue a @ #% $%. Enter all the way to shell mode.
3. In shell mode, use fdisk – L to view all partitions of the computer, and find that the original CentOS partition is sdb9. Grub command enters grub, root (hd1,8) command specifies partition, setup (HD1) installs grub to corresponding partition, and quit grub.

At this time, boot the hard disk again, and you can already see grub. But only windows can start, CentOS will report error, error 17, cannot mount

4. Start the U disk again and enter the shell mode under rescue. Check the grub configuration file of Linux system to see if there is any problem. I have a look, and there is no problem.

#mkdir linux
#mount /dev/sdb9 linux
#cd linux
#cd grub
#vi grub.conf

5. Start the hard disk, enter grub interface, move the cursor to the startup option of Linux, press e key to modify the startup sequence. Change the root (hd0,7) option to root (hd0,8) and enter. It’s ready to start.

New skills get!

Flink 1.1 error: no executorfactory found to execute the application

Error reported when migrating Flink to 1.1:

No ExecutorFactory found to execute the application

After investigation, the reason is: starting from flink1.11, the Flink streaming Java dependency on Flink clients has been removed, and the clients dependency needs to be added manually.

The POM file is as follows, add Flink clients_ 2.12, problem solving.

 

[solved] runtimeerror: module compiled against API version 0xc but this version of numpy is 0xb

This article records the solutions for bloggers to report errors in Import torch in Python. Updated on March 20, 2019.

This error is due to the current version of numpy does not meet the requirements.

First, run on the terminal:

python
import numpy
numpy.version

View the current version of numpy. Run after

pip3 install –upgrade numpy

Just update the numpy version. If it’s python2, use PIP .

More, welcome to the planet discussion.

ansoft:Com Engine non-responsive since

Ansoft :Com Engine Non-responsive since 17:23:04, October 18, 2015.If Persisting for Long, Functional Testing kills the Com Engine Process and Restart Analysis.
When this situation occurs in Ansoft simulation, the progress bar is 0 and unchanged. Many methods have been tried on the Internet, but the software crashed and was closed and then opened, which can be simulated normally.

Several ways to center elements horizontally and vertically

Six ways:
Absolute plus margin solution fixed plus margin solution display:table solution line-height solution flex layout solution transform unknown element width and height solution


Absolute + margin scheme

    div{
        position: absolute;
        width: 100px;
        height: 100px;
        left: 50%;
        top: 50%:
        margin-top: -50px;
        margin-left: -50px;
    }

Fixed plus margin scheme

    div{
        position: fixed;
        width: 100px;
        height: 100px;
        top: 0;
        right:0;
        left: 0;
        bottom: 0;
        margin: auto;
    }

Display: table scheme

    div{
        display: table-cell;
        vertical-align: middle;
        text-align: center;
        width: 100px;
        height: 100px;
    }

The line-height scheme for the inline element

    div{
        text-align: center;
        line-height: 100px;
    }

Flex Flexible Layout Solution

    div{
        display: flex;
        align-items: center;
        justify-content:center
    }

Transform unknown element width and height solution

    div{
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%)
    }

Ubutnu’s idea input method candidate box can’t follow the cursor

Problem orientation
In fact, the specific issue of the official seven years ago (reference), but the more pit is that the official has not solved the problem. Simply put, a bug in the JRE running environment of IDEA causes the input method to be unable to locate the mouse position. Therefore, we need to modify the running code of JetBrainsRuntime to fix this problem.
The solution

Modify JetBrainsRuntime

    Download the modified JRE environment
https://pan.baidu.com/s/1S6cEKQS9w9dKqCrlO4QJwg
Extract code: 21MR

    Change the startup environment for IDEA

Change your own JRE directory

/home/ XXX /idea-2020.1/bin/idea.shhome/XXX /idea-2020.1/bin/idea.sh

port IDEA_JDK=/home/ XXX /idea-2020.1/java-11.0.7-jetbrain.>r> export IDEA_JDK=/home/ XXX /idea-2020.1/java-11.0.7-jetbrain
Appendix:
JetBrainsRuntime

Error: solution to the problem of cannot find module ‘webpack / bin / config yargs’

In terminal use of VSCode, using NPM run dev causes an error

Error: Cannot find module 'webpack/bin/config-yargs

It is possible that the webpack-dev-server version number is too low
The solution
Uninstall webpack-dev-server globally first

npm uninstall webpack-dev-server -g

Then install the latest version

npm install [email protected]

Vscode cnpm: unable to load file, but open console with CMD without error

Question:
Install CNPM on the new computer. When running CNPM-V in VSCODE terminal, the following error will be reported:

CNPM: Unable to load file
C:\Users\Administrator\AppData\ NPM \cnpm.ps1 because script is not allowed to run on this system. For more information, please refer to the
https:/go.microsoft.com/fwlink/?
about_Execution_Policies in LinkID=135170. Position line :1 character :1
cnpm -v

  + CategoryInfo          : SecurityError: (:) [],PSSecurityException
  + FullyQualifiedErrorId : UnauthorizedAccess

Solution:
(1) Run VS Code as an administrator and open a terminal in VS Code
(2) Execute Get-ExecutionPolicy at the terminal, displaying Restricted
(3) Update the PowerShell policy and execute it on the terminal: set-executionpolicy RemoteSigned
(4) Examine the status of the policy again and execute: GET-EXECUTIONPOLICY at the terminal to show the RemoteSigned igned
(5) Re-input CNPM-V problem successfully solved
Just taking notes.

Python error open SSL.SSL.SysCallError :(-1,‘Unexpected EOF‘)

Ssl. syscallError :(-1,’Unexpected EOF’)
Verify = False: verify = False: verify = False: verify = False

Request, when using a proxy to crawl a web page
Verify = False; verify = False
code

URL = "https://docs.google.com/uc?export=download"

session = requests.Session()

response = session.get(URL, params = { 'id' : id }, stream = True )

Verify = False

URL = "https://docs.google.com/uc?export=download"

session = requests.Session()

response = session.get(URL, params = { 'id' : id }, stream = True, verify = False )

Node configuration environment variable and global installation of webapck

1. Installation of node in the underlying environment
Node website: https://nodejs.org
NPM doesn’t need to be installed by itself; Node comes with NPM
Enter Node-v and NPM-V in CMD to see the versions of Node and NPM
2. Configure node’s environment variables
If you install node using the default installation address, you do not need to configure the environment variable
. If you change the default address when installing node, you will need to configure the environment variable
My installation address is the NodeJS file on disk F
“F:\nodejs\node_global”
NPM config set “F:\nodejs\node_global”
NPM config set cache “F:\nodejs\node_cache”

“F:\nodejs\node_cache”
Next, configure the environment variable
and create a new variable in the system variable
variable name: NODE_PATH
variable value: F:\nodejs\node_global\node_modules create a new variable in the path of the system variable enter
%NODE_PATH% open path in the user variable create a new variable F:\nodejs\node_global
if there are other variable statements in the path related to node or NPM, especially under C, If new files are generated in the node_cache and node_global folders, then the node environment is configured successfully

3. Install global WebPack
The NPM install webpack-g statement we just used to test node’s environment variables is the global installation statement for webpack, so we have already installed the global webpack
. Since I reported almost every error I could when installing webpack, just in case, let’s install it again!
Then we install
in CMD to execute NPM install — global webpack using the installation statement provided on wabpack’s official website
Since it is installed in NPM, so the installation speed is a little slow, the left ellipsis is the progress bar, we try to install in a good network environment, otherwise it will get stuck to your despair
Once installed, execute Webpack-V in CMD if the version number appears to indicate a successful installation.

User CF itemcf collaborative filtering algorithm based on user and item

UserCF:
weight coefficient: the similarity between all non-target users and Target users, normalized (that is, the sum is 1).
calculates the score of the ith item by multiplying the score of the Target item by the weight factor of the non-target user.
considering that some users like high score and some like low score, decentralization + centralization strategy is often adopted.

1 2 3 4 5
A 10 9 9 8 10
B 7 4

6 6 5
C 10 7 10 10 10
D 10 9 7 7 9
E 6<10/td>

7

8

?

For here

S

E

.

5

S_{E,5}

SE, the value of 5:
1. Calculate the similarity of user 1-4 and 5 (use the value of goods A-> D);
2. Normalization of similarity, that is, the sum of 4 similarities is 1; 3. The ith similarity times (the ith user’s rating of item E – the ith user’s average rating of all items) (decentralize), sum the four results, and add the average rating of Target user (centralize). I = 1, 2, 3, 4.
ItemCF:
weight coefficient: similarity of non-target goods, and normalized (making the sum 1);
then multiply each non-target user’s rating of the Target product by the weight coefficient to get the Target user’s rating.
Ditto for

S

E

.

5

S_{E,5}

The value of SE,5:
1. Calculate the similarity of goods a-d and E (using 1-4 users with ratings);
2. Normalization of similarity coefficient; 3. The ith similarity multiplied by (user 5’s score for item j – user 5’s average score for all items) (decentralize), sum the four results, plus the average score for item E from user 1-4 (centralize). Ibid., j=A,B,C,D.