Author Archives: Robins

[Solved] RuntimeError: a view of a leaf Variable that requires grad is being used in an in-place

yolov5 Error: RuntimeError: a view of a leaf Variable that requires grad is being used in an in-place

Solution:
In model/yolo.py file

        for mi, s in zip(m.m, m.stride):  # from
            b = mi.bias.view(m.na, -1)  # conv.bias(255) to (3,85)
            b[:, 4] += math.log(8/(640/s) ** 2)  # obj (8 objects per 640 image)
            b[:, 5:] += math.log(0.6/(m.nc - 0.99)) if cf is None else torch.log(cf/cf.sum())  # cls
            mi.bias = torch.nn.Parameter(b.view(-1), requires_grad=True)

Add with torch.no_grad(): as follows

        for mi, s in zip(m.m, m.stride):  # from
            b = mi.bias.view(m.na, -1)  # conv.bias(255) to (3,85)
            with torch.no_grad():
                b[:, 4] += math.log(8/(640/s) ** 2)  # obj (8 objects per 640 image)
                b[:, 5:] += math.log(0.6/(m.nc - 0.99)) if cf is None else torch.log(cf/cf.sum())  # cls
            mi.bias = torch.nn.Parameter(b.view(-1), requires_grad=True)

——> The root cause is to add:

with torch.no_grad():

[Solved] SyntaxError: Invalid regular expression: invalid group specifier name

SyntaxError: Invalid regular expression: invalid group specifier name

Regular problem

SafariSyntaxError: Invalid regular expression: invalid group specification name
FirefoxSyntaxError: invalid regexp group
Mobile terminal: Android is normal, iOS is not

reason

Firefox, IE, and IOS do not support the following writing methods: ?<=, ?<!, ?!, ?=

Look ahead is a kind of conditional judgment, such as if statement
(?=exp) the position that satisfies expression exp after positive look ahead match
(?!exp) the position that does not satisfy expression exp after negative look ahead match

Solution:

let reg = /ab?<=cd/
Modify to
let reg = new RegExp('ab(?<=cd)')

ERROR [Executor task launch worker for task 30867] NebulaEdgeWriter:52 – failed to write

ERROR [Executor task launch worker for task 30867] NebulaEdgeWriter:52 – failed to write

11:32:16,614 ERROR [Executor task launch worker for task 30867] NebulaEdgeWriter:52 - failed to write INSERT edge `SUPPLIER_AVERAGE_QUOTA`(`four_level_name`,`start_time`,`push_time`,`quote_cycle`) VALUES -7708723366638923441->-7708723366638923441@6325772268643779185: ("Shock Absorber", "2022-05-16 18:25:24", "2022-05-17 09:57:34", "2") for Storage Error: More than one request trying to add/update/delete one edge/vertex at the same time.
11:32:16,614 ERROR [Executor task launch worker for task 30868] NebulaEdgeWriter:52 - failed to write INSERT edge `SUPPLIER_AVERAGE_QUOTA`(`four_level_name`,`start_time`,`push_time`,`quote_cycle`) VALUES -7708723366638923441->-7708723366638923441@6325772268643779185: ("Shock Absorber", "2022-05-16 18:25:24", "2022-05-17 09:57:34", "2") for Storage Error: More than one request trying to add/update/delete one edge/vertex at the same time.
11:32:18,658 ERROR [Executor task launch worker for task 30901] NebulaEdgeWriter:52 - failed to write INSERT edge `SUPPLIER_AVERAGE_QUOTA`(`four_level_name`,`start_time`,`push_time`,`quote_cycle`) VALUES 8524141067397973150->8524141067397973150@-2616939442014903388: ("Color Paint", "2022-01-15 17:11:57", "2022-01-17 17:20:07", "3") for Storage Error: More than one request trying to add/update/delete one edge/vertex at the same time.
11:32:22,097 ERROR [main] NebulaDataSourceEdgeWriter:98 - failed execs:
 List(INSERT edge `SUPPLIER_AVERAGE_QUOTA`(`four_level_name`,`start_time`,`push_time`,`quote_cycle`) VALUES -7708723366638923441->-7708723366638923441@6325772268643779185: ("Shock Absorber", "2022-05-16 18:25:24", "2022-05-17 09:57:34", "2"))
11:32:22,097 ERROR [main] NebulaDataSourceEdgeWriter:98 - failed execs:
 List(INSERT edge `SUPPLIER_AVERAGE_QUOTA`(`four_level_name`,`start_time`,`push_time`,`quote_cycle`) VALUES -7708723366638923441->-7708723366638923441@6325772268643779185: ("Shock Absorber", "2022-05-16 18:25:24", "2022-05-17 09:57:34", "2"))
11:32:22,097 ERROR [main] NebulaDataSourceEdgeWriter:98 - failed execs:
 List(INSERT edge `SUPPLIER_AVERAGE_QUOTA`(`four_level_name`,`start_time`,`push_time`,`quote_cycle`) VALUES 8524141067397973150->8524141067397973150@-2616939442014903388: ("Color Paint", "2022-01-15 17:11:57", "2022-01-17 17:20:07", "3"))

 

Solution: The data should be skewed, add this when partitioning can be

[Endnote X9 Error] Unable to search online – prompt windows error 12029

Endnote failed to search online, prompting Windows error 12029. The solution is as follows:

In the IE browser, click the Internet option, select Advanced, and then select TLS1.2 from the drop-down box of Settings.

The official solution is invalid on my computer:

You can download the file using the link below :-

Connection Files

#Update Pubmed File

Proceed to open the downloaded file, and then click File > Save as and proceed to remove the copy and save to override this file.

[Solved] Error updating database. Cause: java.sql.SQLException: Unknown initial character set index ‘255‘ re

The following problem was suddenly reported as an error while conducting the test:
Error updating database.  Cause: java.sql.SQLException: Unknown initial character set index ‘255’ received from server. Initial client character set can be forced via the ‘characterEncoding’ property.
Error:

org.apache.ibatis.exceptions.PersistenceException: 
### Error updating database.  Cause: java.sql.SQLException: Unknown initial character set index '255' received from server. Initial client character set can be forced via the 'characterEncoding' property.
### Cause: java.sql.SQLException: Unknown initial character set index '255' received from server. Initial client character set can be forced via the 'characterEncoding' property.

	at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
	at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:200)
	at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:185)
	at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:57)
	at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:59)
	at com.sun.proxy.$Proxy12.insertEncodeProperties(Unknown Source)
	at test.MyTest.test1(MyTest.java:50)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69)
	at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
	at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:220)
	at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:53)
Caused by: java.sql.SQLException: Unknown initial character set index '255' received from server. Initial client character set can be forced via the 'characterEncoding' property.

jdbc.properties file

Solution: If the error prompt is a character encoding problem, add the character encoding setting after the URL

jdbc.url=jdbc:mysql:///mybatis_test_db?characterEncoding=utf8

error LNK2019: Unresolvable external symbols “__declspec(dllimport) public: int __thiscall QString::toWCharArray(wchar_t

Problem: Compiling poppler-0.42.0\qt4 on win10 with cmake and vs2010 reports the following error.

2>poppler-document.obj : error LNK2019: Unresolvable external symbol “__declspec(dllimport) public: int __thiscall QString::toWCharArray(wchar_t *)const ” (__imp _?toWCharArray@QString@@@QBEHPA_W@Z), the symbol in the function “public: __thiscall Poppler::DocumentData::DocumentData(class QString const &,class GooString * ,class GooString *)” (? ? 0DocumentData@Poppler@@QAE@ABVQString@@@PAVGooString@@1@Z) is referenced in

Reason: The Qt library itself compiles with /Zc:wchar_t- , if your program compiles with /Zc:wchar_t it will cause the compiler to have different rules for adapting function names
Whichever one it is, consistency is good.

Solution: Project – Properties – C/C++ – Language, Set wchar_t as a built-in type and change it to match the Qt library

[Solved] Error:E0415 no suitable constructor exists to convert from “int“ to “Rational“

Scene:

The problem is that the constructor for is missing or is declared as explicit.

Please refer to the following scenario.

#include <iostream>

using std::cout;
using std::endl;

class Rational1
{
public:
	Rational1(int n = 0, int d = 1):num(n), den(d)
	{
		cout << __func__ << "(" << num << "/" << den << ")" << endl;
	}

public:
	int num; 
	int den;
};

class Rational2
{
public:
	explicit Rational2(int n = 0, int d = 1) :num(n), den(d)
	{
		cout << __func__ << "(" << num << "/" << den << ")" << endl;
	}

public:
	int num;
	int den;
};

void Display1(Rational1 r)
{
	cout << __func__ << endl;
}

void Display2(Rational2 r)
{
	cout << __func__ << endl;
}


int main()
{
	Rational1 r1 = 11;
	Rational1 r2(11);
	Rational2 r3 = 11; // error E0415
	Rational2 r4(11);

	Display1(1);
	Display2(2); // error  E0415
	return 0;
}

Explicit keyword

1. Specifies that the constructor or conversion function (from C++11) is explicit, that is, it cannot be used for implicit conversion and copy initialization
2. Explicit can be used with constant expressions The function is explicit if and only if the constant expression evaluates to true (From C++20)

Problem description

Error:E0415 no suitable constructor exists to convert from “int“ to “Rational“

Solution:

1. Implement the corresponding constructor yourself. (Recommended)
2. Delete the constructor modified by the explicit keyword. (Not recommended)

How to Solve elasticsearch and logstash Install Error

Turning on the logstash service appears: Failed to start logstash.service: Unit not found.

[root@localhost ~]# systemctl start logstash
Failed to start logstash.service: Unit not found.

Issue 1:
First problem: Failed to start logstash.service: Unit not found.
Solution idea.
Generate logstash.service file

[root@localhost ~]# sudo /usr/share/logstash/bin/system-install /etc/logstash/startup.options systemd

Check if the service can be opened normally

Issue 2:
The second problem: If you use this access could not find any executable java binary. Please install java in your PATH or set JAVA_HOME.

[root@localhost ~]# sudo /usr/share/logstash/bin/system-install /etc/logstash/startup.options systemd
Could not find any executable java binary. Please install java in your PATH or set JAVA_HOME.

Reason: logstash can’t get to AVA_HOME variable, need to add refresh profile in the configuration file
Solution.

[root@localhost ~]# vi /etc/profile                #Add the specified version of the JDK directory installed on the local machine
export JAVA_HOME=/usr/local/jdk1.8
export CLASSPATH=$JAVA_HOME/lib:$JAVA_HOME/jre/lib
export PATH=$JAVA_HOME/lib:$JAVA_HOME/jre/bin:$PATH:$HOME/bin

[root@localhost ~]# vi /usr/share/logstash/bin/logstash.lib.sh
Add source /etc/profile in the last line
[root@localhost ~]# vi /usr/share/logstash/bin/logstash
Add source /etc/profile in the last line

Refresh the configuration file, and then see if the service can be opened normally

Issue 3:
Third problem : /usr/share/logstash/vendor/jruby/bin/jruby:line 388: /usr/bin/java: No that file or directory
Unable to install system startup script for Logstash.
Reason: Can’t get the java executable file
Solution:

[root@localhost ~]# ln -s /usr/local/jdk1.8/bin/java /usr/bin/java

Reinstall the service to install.

[root@localhost ~]# rpm -e logstash
Error: package logstash is not installed
[root@localhost ~]# rpm -ivh /mnt/logstash-5.5.1.rpm
Warning: /mnt/logstash-5.5.1.rpm: Head V4 RSA/SHA512 Signature, key ID d88e42b4: NOKEY
In preparation…                          ################################# [100%]
Package logstash-1:5.5.1-1.noarch is installed

Generate logstash.service file

[root@localhost ~]# sudo /usr/share/logstash/bin/system-install /etc/logstash/startup.options systemd
Using provided startup.options file: /etc/logstash/startup.options

Start successfully!

[root@localhost ~]# systemctl start logstash

[Solved] Hexo FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed

After I upgrade npm, an error report:

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed
0xb00d90 node::Abort() [hexo]

Solution: The cause is memory overflow

Increase memory

sudo npm i -g increase-memory-limit
increase-memory-limit
    Expand the memory for NODE operation
export NODE_OPTIONS=--max_old_space_size=4096

The value should not be too large, which may affect the server operation

[Solved] AttributeError: module ‘time‘ has no attribute ‘clock‘

preface:

When the blogger runs the previous code, he encounters this problem because time method is not available in the higher version of Python.

Running code:

Error:

Traceback (most recent call last):
  File "/media/gis/DISCK_21/code/CoANet-main/process/create_crops.py", line 139, in <module>
    main()
  File "/media/gis/DISCK_21/code/CoANet-main/process/create_crops.py", line 118, in main
    start = time.clock()
AttributeError: module 'time' has no attribute 'clock'

Solution:

start = time.time()