Category Archives: How to Fix

OSError: SavedModel file does not exist at: ./model/facenet_keras.h5

Today, when I imported the face recognition model built by keras into the Django framework to run, the system reported oseeeor, and the display file does not exist, but I can run it normally when I run the model alone. Finally, we get the following two solutions.

Solution

Method 1

This method is a problem encountered by others when I was looking for a solution, although it did not solve my problem:)
it may be that the environment of the framework was destroyed after the model was imported, and the file path was changed, which can be solved by re installing py

pip3 uninstall h5py
pip3 installl h5py

Method 2: path problem

It seems that this solution has not been mentioned, but it has solved my problem
although the relative path can be used to run the model alone, it should be changed to absolute path under Django. As for why, I’m not sure.

Error in machine learning training data (FIT): valuee rror:Unknown label type:‘continuous‘

I haven’t found the right solution on the Internet, including CSDN. They are all converted to int or multiplied by a number, but actually for the regression task, the label of floating-point number can’t be changed, which will greatly affect the error. My solution is to convert to int first, and then to floating point first

Specifically, for example, y. astype (int). Astype (float)

Change root to Oracle, and error: can’t open display: can’t open

If we find the error can’t open when we install Oracle Software display:127.0.0.1 :0.0   , probably   Display can’t find the graphic link library corresponding to 127.0.0.1, so you need to use export display =: 0.0 to make the system automatically find the matching graphic link library,

And modify the overall settings in/home/Oracle /. Bash_ The display parameter in the profile file is =: 0.0.

export DISPLAY= localhost:10.0

Use the xclock command to test the result, if it still reports an error.

Maybe it’s the root environment when the GUI logs in, and then you convert it to an Oracle environment, such as   su –   oracle   , This may also lead to this error. Error: Can’t open display:127.0..0.1 :0.0    
 
Suppose that the Linux account for installing Oracle Software is Oracle,    Then we need to log in to the GUI directly as an Oracle user instead of switching to Oracle after logging in as root,    We can set the VNC corresponding to the Oracle user (to install the user environment settings of Oracle)   , Then login VNC as Oracle user to install.

 
If there is a libxp type error, it may be that the RPM package of libxp is not installed.

error This is probably not a problem with npm. There is likely additional logging output above.

Nextjs program released, reported a pile of errors

18 verbose node v14.11.0
19 verbose npm  v6.14.8
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] build: `next build`
22 error Exit status 1
23 error Failed at the [email protected] build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

Maybe due to the version update,
the solution is to install it again. It is recommended to empty all the previous ones

rm -rf node_modules
rm package-lock.json
npm cache clear --force
npm install

 

After Nacos started, the client worker log was printed all the time

After Nacos started, the client worker log was printed all the time

Phenomenon

Print the clientworker log all the time

2020-08-24 00:57:30.977 INFO  [12932] --- [.cn_8848-public] c.a.n.client.config.impl.ClientWorker    : [fixed-nacos.itlym.cn_8848-public] [data-received] dataId=common.yml, group=DEFAULT_GROUP, tenant=public, md5=8c191cace81179b01fb745b5d027c1c8, content=xxx
2020-08-24 00:57:30.989 INFO  [12932] --- [.cn_8848-public] c.a.n.client.config.impl.ClientWorker    : [fixed-nacos.itlym.cn_8848-public] [data-received] dataId=sms-center.yml, group=DEFAULT_GROUP, tenant=public, md5=f12bc945ba0c1d39f3dea2e0977db712, content=xxx
...

Cause analysis

Root cause

Having seen the source code of Nacos before, Nacos will check whether the configuration items are consistent with the server configuration items every 10ms. If not, it will pull the latest configuration from the server therefore, if the MD5 algorithms of Nacos client and Nacos server are different, it will lead to misjudgment, thus constantly refreshing and printing the client worker logs.

Direct cause

My Nacos server is 1.3, and the client uses spring cloud Alibaba. Version . Click to find that the Nacos client version is 1.2

			<dependency>
                <groupId>com.alibaba.cloud</groupId>
                <artifactId>spring-cloud-alibaba-dependencies</artifactId>
                <version>2.2.1.RELEASE</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

Here, the spring-cloud-alibaba-dependencies‘s official website and warehouse have not been updated for a long time, which is easy to make complaints about users and waste a lot of investigation time.

Other possible reasons

The public is set in the namespace. See the Nacos GitHub

At this time, the best way to solve this problem is not to set the namespace. Otherwise, when Nacos releases a new version, it may be 1.4

Solution

Method 1:

Change the version of client and Nacos server to the same, as follows

client:
<dependency>
    <groupId>com.alibaba.cloud</groupId>
    <artifactId>spring-cloud-alibaba-dependencies</artifactId>
    <version>${spring-cloud-alibaba.version}</version>
    <type>pom</type>
    <scope>import</scope>
    <exclusions>
    <exclusion>
        <artifactId>com.alibaba.nacos</artifactId>
        <groupId>nacos-client</groupId>
    </exclusion>
    </exclusions>
</dependency>
<dependency>
    <groupId>com.alibaba.nacos</groupId>
    <artifactId>nacos-client</artifactId>
    <version>1.3.2</version>
</dependency>

Method 2:

Because spring cloud Alibaba dependencies leaves the gap of properties specified version (default < nacos.client.version> 1.2.1)
so you only need to add

<properties>
	<nacos.client.version>1.2.1</nacos.client.version>
</properties>

Note: if spring cloud starter Nacos config is introduced, it can’t be avoided by this scheme, because ‘spring cloud Alibaba dependencies’ has hard coding problems. When importing, you should actively specify the version.

			 <dependency>
                <groupId>com.alibaba.cloud</groupId>
                <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
                <version>1.3.0</version>
            </dependency>

Method 3 (middleware upgrade scheme suitable for existing system):

Download the Nacos client Version 1.2.1 code, modify its md5util package path to a new one, and then re publish it to the local or private warehouse.

There is more than one Web fragment with the same name: “spring_web”.

There is more than one web fragment with the same name: “spring”_ Web “. Error
software used: idea

Error location:

According to the error prompt, say there are duplicate modules, that is, find the duplicate module and delete it.

Solution:

In the upper right running setting of idea, open edit configuration – select your Tomcat server on the left – Deployment – select your component – Pencil Icon on the right – arts to see if there is any extra XXX explored (XXX is the project name)

Destructor abnormal stuck bug

The cause of the bug

When sending messages, this interface needs to be rewritten. If the rewritten method throws an exception and does not capture it, the program will be stuck and will not execute the
Destroy source code

package com.lmax.disruptor;

public interface EventTranslatorVararg<T> {
    void translateTo(T var1, long var2, Object... var4);
}

Problem code

public class Main {
    public static void main(String[] args) {
        Disruptor<Message> disruptor = new Disruptor<>(
                Message::new,
                1024,
                (ThreadFactory) Thread::new);
        disruptor.handleEventsWith((EventHandler<Message>) (message, l, b) -> {
            System.out.println("Handling messages " + message);
        });
        disruptor.start();
        RingBuffer<Message> ringBuffer = disruptor.getRingBuffer();

        for(int i = 0; i<10; i++){
            Message message = new Message(String.valueOf(i));
            ringBuffer.publishEvent((m, l) -> 
            	throw new RuntimeException();
            );// Throwing exceptions without catching and finding that the program cannot be terminated
        }

        System.out.println("hi");	//hi Will not output
        disruptor.shutdown();//shutdown the disruptor, the method will block until all events have been handled.
    }
    
}

result:

The main thread exits, but the program continues to run without stopping

solve:

Handle exceptions on call

public class Main {
    public static void main(String[] args) {
        Disruptor<Message> disruptor = new Disruptor<>(
                Message::new,
                1024,
                (ThreadFactory) Thread::new);
        disruptor.handleEventsWith((EventHandler<Message>) (message, l, b) -> {
            System.out.println("Handling messages " + message);
        });
        disruptor.start();
        RingBuffer<Message> ringBuffer = disruptor.getRingBuffer();

        for(int i = 0; i<10; i++){
            Message message = new Message(String.valueOf(i));
            ringBuffer.publishEvent((m, l, m2) -> {
                try {
                    throw new RuntimeException();
                }catch (Exception e){
                    e.printStackTrace();
                }
            });// Handle exceptions, find program print exceptions and can end
        }

        System.out.println("hi");
        disruptor.shutdown();//Close the disruptor and the method will block until all events have been processed.
    }
    
}

Message.java

public class Message {
    String id;

    public Message(String id) {
        this.id = id;
    }

    public Message() {
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Override
    public String toString() {
        return "Message{" +
                "id='" + id + '\'' +
                '}';
    }

}

Playing audio in termux

I have tried all kinds of apt install software, using Python library to write code to run (all kinds of libraries are not available), using java to write code to run (using Android’s own API), all failed. The reasons all point to one point: there is no default audio.

Analysis: because the execution environment is termux, there is no default setting in termux. Android is the real system of the outer system of termux. As long as the sound card, driver, default device and so on are set in termux, they can also be executed after setting.

Here’s a simpler way:

Premise: tinyalsa, root identity, a 44.1KHz audio, turn on the volume

Play command:

./tinyalsa play ~/test.wav

 
View command:

/tinyalsa tinymix

./tinyalsa tinypcminfo -D /proc/asound/cards

cat /proc/asound/cards

 
Set the output device to speaker:

/tinyalsa tinymix 0 SPK

 
Write the play command into a script, give him permission, you can play and use it freely!

After a variety of searches, a better solution was found:

Better and simpler solutions

Eclipse gets stuck saving copy and paste

When editing long code in eclipse, eclipse often gets stuck for a long time when using Ctrl.  
the guess is that you can click and jump to the variable definition after holding down Ctrl in eclipse, so when you press Ctrl, eclipse will generate this mapping. When the file is large, this behavior will take a lot of time. You can set shortcut keys by the following methods.  

Eclipse — Windows-> Preferences-> General-> Editors-> Text Editors-> Hyperlinking:  
Remove this option: enable on demand hyperlinks style navigation  

CANNOT LINK EXECUTABLE: cannot locate symbol

This problem occurs in termux. You can’t locate the link library, that is, you can’t find the dependent library file. You just need to put the corresponding library in the environment variable.

If his error message contains   Referenced by/system/lib64 /, then add the corresponding location to the environment variable and execute the following command

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/system/lib64/

 

Termux installing redis

When I compile and install redis under termux, there are such errors as use of undeclared identifier.. my CC compiler and its dependent components are the latest version, but there are still problems. The reason is unknown. It indicates that the method is not declared at compile time. It is estimated that the CPU is weak and the compile execution order is related. It is just a guess.

Use the following solution directly:

apt install redis

That’s it. The bin executor is placed in usr/bin by default, and the configuration file is in usr/etc.