Tag Archives: Experience sharing

[Solved] original_keras_version = f.attrs[‘keras_version‘].decode(‘utf8‘)

windows system:
original_keras_version = f.attrs[‘keras_version’].decode(‘utf8’)
1. error:

load_weights_from_hdf5_group
    original_keras_version = f.attrs['keras_version'].decode('utf8')

AttributeError: 'str' object has no attribute 'decode'

2. Cause analysis

When installing tensorflow, the default installed h5py is 3.1.0, and an error is reported because the TF you installed does not support an excessively high version of h5py

3. Solutions

1. Uninstall h5py3 Version 1.0, installing h5py2.0 Version 10.0.2. Restart the compiler

pip install h5py==2.10.0

Dubbo Frame Write Junit Error: ERROR org.springframework.test.context.Testcontextmanager

Solution:

Since the Dubbo framework is used, on the premise that we confirm that there is no problem with JUnit unit test environment:

First, check whether the Dubbo service is enabled; Secondly, if the test class is written in the consumer module, you need to check whether the provider service is enabled;

Start the corresponding service to solve the problem.


Detailed error reporting information is as follows:

[main] ERROR org. springframework. test. context. TestContextManager – Caught exception while allowing TestExecutionListener [org.springframework.test.context.support. [email protected] ] to prepare test instance [com.yangdaxian.test. [email protected] ]

Some detailed error messages are as follows:

19:51:44.947 [main] ERROR org.springframework.test.context.TestContextManager - Caught exception while allowing TestExecutionListener [org.springframewor[email protected]333398f] to prepare test instance [[email protected]]
java.lang.IllegalStateException: Failed to load ApplicationContext
	at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:125) ~[spring-test-5.1.5.RELEASE.jar:5.1.5.RELEASE]
	at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:108) ~[spring-test-5.1.5.RELEASE.jar:5.1.5.RELEASE]
	at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:118) ~[spring-test-5.1.5.RELEASE.jar:5.1.5.RELEASE]
	at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:83) ~[spring-test-5.1.5.RELEASE.jar:5.1.5.RELEASE]
	at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:246) [spring-test-5.1.5.RELEASE.jar:5.1.5.RELEASE]
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:227) [spring-test-5.1.5.RELEASE.jar:5.1.5.RELEASE]
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:289) [spring-test-5.1.5.RELEASE.jar:5.1.5.RELEASE]
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) [junit-4.12.jar:4.12]
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:291) [spring-test-5.1.5.RELEASE.jar:5.1.5.RELEASE]
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:246) [spring-test-5.1.5.RELEASE.jar:5.1.5.RELEASE]
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:97) [spring-test-5.1.5.RELEASE.jar:5.1.5.RELEASE]
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) [junit-4.12.jar:4.12]
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) [junit-4.12.jar:4.12]
	at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) [spring-test-5.1.5.RELEASE.jar:5.1.5.RELEASE]
	at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70) [spring-test-5.1.5.RELEASE.jar:5.1.5.RELEASE]
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363) [junit-4.12.jar:4.12]
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:190) [spring-test-5.1.5.RELEASE.jar:5.1.5.RELEASE]
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137) [junit-4.12.jar:4.12]
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69) [junit-rt.jar:?]
	at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33) [junit-rt.jar:?]
	at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:221) [junit-rt.jar:?]
	at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:54) [junit-rt.jar:?]
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'newsController': Injection of @DubboReference dependencies is failed; nested exception is java.lang.IllegalStateException: Failed to check the status of the service com..service.NewsService. No provider available for the service com..service.NewsService from the url dubbo://192.168.66.1/com.yangziqiang.service.NewsService?application=demo-consumer&dubbo=2.0.2&init=false&interface=com.yangziqiang.service.NewsService&metadata-type=remote&methods=count1,listNews,showMsg&pid=17984&register.ip=192.168.66.1&release=2.7.10&side=consumer&sticky=false&timestamp=1640001099664 to the consumer 192.168.66.1 use dubbo version 2.7.10
	at com.alibaba.spring.beans.factory.annotation.AbstractAnnotationBeanPostProcessor.postProcessPropertyValues(AbstractAnnotationBeanPostProcessor.java:149) ~[spring-context-support-1.0.10.jar:?]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1400) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:592) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:849) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:877) ~[spring-context-5.1.5.RELEASE.jar:5.1.5.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549) ~[spring-context-5.1.5.RELEASE.jar:5.1.5.RELEASE]
	at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:128) ~[spring-test-5.1.5.RELEASE.jar:5.1.5.RELEASE]
	at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:60) ~[spring-test-5.1.5.RELEASE.jar:5.1.5.RELEASE]
	at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.delegateLoading(AbstractDelegatingSmartContextLoader.java:275) ~[spring-test-5.1.5.RELEASE.jar:5.1.5.RELEASE]
	at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.loadContext(AbstractDelegatingSmartContextLoader.java:243) ~[spring-test-5.1.5.RELEASE.jar:5.1.5.RELEASE]
	at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:99) ~[spring-test-5.1.5.RELEASE.jar:5.1.5.RELEASE]
	at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:117) ~[spring-test-5.1.5.RELEASE.jar:5.1.5.RELEASE]
	... 24 more
Caused by: java.lang.IllegalStateException: Failed to check the status of the service 

[Solved] Keil5 burn STM32F chip Error: error: Flash download failed – “cortex-m4″“

Load “…\Obj\Laliji.axf”
Set JLink Project File to “F:\01MCU\STM32F429\TestProgram\Project\JLinkSettings.ini”
JLink Info: Device “STM32F429IG” selected.

JLink info:
DLL: V4.98e, compiled May 5 2015 11:00:52
Firmware: J-Link V10 compiled Oct 15 2018 16:40:35
Hardware: V10.10
S/N : 260106173
Feature(s) : FlashBP, GDB, FlashDL, JFlash, RDI
JLink Info: Found SWD-DP with ID 0x2BA01477JLink Info: Found SWD-DP with ID 0x2BA01477JLink Info: Found Cortex-M4 r0p1, Little endian.JLink Info: FPUnit: 6 code (BP) slots and 2 literal slotsJLink Info: CoreSight components:JLink Info: ROMTbl 0 @ E00FF000JLink Info: ROMTbl 0 [0]: FFF0F000, CID: B105E00D, PID: 000BB00C SCSJLink Info: ROMTbl 0 [1]: FFF02000, CID: B105E00D, PID: 003BB002 DWTJLink Info: ROMTbl 0 [2]: FFF03000, CID: B105E00D, PID: 002BB003 FPBJLink Info: ROMTbl 0 [3]: FFF01000, CID: B105E00D, PID: 003BB001 ITMJLink Info: ROMTbl 0 [4]: FFF41000, CID: B105900D, PID: 000BB9A1 TPIUJLink Info: ROMTbl 0 [5]: FFF42000, CID: B105900D, PID: 000BB925 ETM
ROMTableAddr = 0xE00FF003

Target info:
Device: STM32F429IG
VTarget = 3.270V
State of Pins:
TCK: 0, TDI: 1, TDO: 1, TMS: 1, TRES: 1, TRST: 1
Hardware-Breakpoints: 6
Software-Breakpoints: 8192
Watchpoints: 4
JTAG speed: 5000 kHz
No Algorithm found for: 08000000H - 08001073H
Erase skipped!
Error: Flash Download failed - “Cortex-M4”
Flash Load finished at 14:46:07

 

Solution:
1, click the magic wand of keil interface (Alt + F7)
2, Settings

3, Flash Download -> add

4, choose the type of chip-> add

[Solved] tomcat Startup Error: java.lang.SecurityException: Invalid signature file digest for Manifest main attributes

Error: invalid signature file digest for manifest main attributes

The project runs normally on the local machine, but it cannot be started when deployed to the Tomcat of the server. The following error is reported:

Caused by: java.lang.SecurityException: Invalid signature file digest for Manifest main attributes
        at sun.security.util.SignatureFileVerifier.processImpl(SignatureFileVerifier.java:239) [:1.6.0_30]
        at sun.security.util.SignatureFileVerifier.process(SignatureFileVerifier.java:193) [:1.6.0_30]
        at java.util.jar.JarVerifier.processEntry(JarVerifier.java:296) [:1.6.0_30]
        at java.util.jar.JarVerifier.update(JarVerifier.java:207) [:1.6.0_30]
        at java.util.jar.JarFile.initializeVerifier(JarFile.java:342) [:1.6.0_30]
        at java.util.jar.JarFile.getInputStream(JarFile.java:410) [:1.6.0_30]
        at org.jboss.vfs.spi.JavaZipFileSystem.getFile(JavaZipFileSystem.java:159) [jboss-vfs.jar:3.0.0.GA]
        at org.jboss.vfs.VirtualFile.getPhysicalFile(VirtualFile.java:262) [jboss-vfs.jar:3.0.0.GA]
        at org.jboss.web.deployers.AbstractWarDeployer$1.visit(AbstractWarDeployer.java:853) [:6.0.0.Final]
        at org.jboss.vfs.VirtualFile.visit(VirtualFile.java:408) [jboss-vfs.jar:3.0.0.GA]
        at org.jboss.vfs.VirtualFile.visit(VirtualFile.java:410) [jboss-vfs.jar:3.0.0.GA]
        at org.jboss.vfs.VirtualFile.visit(VirtualFile.java:410) [jboss-vfs.jar:3.0.0.GA]
        at org.jboss.vfs.VirtualFile.visit(VirtualFile.java:410) [jboss-vfs.jar:3.0.0.GA]
        at org.jboss.vfs.VirtualFile.visit(VirtualFile.java:396) [jboss-vfs.jar:3.0.0.GA]
        at org.jboss.web.deployers.AbstractWarDeployer.getExplodedWarUrl(AbstractWarDeployer.java:866) [:6.0.0.Final]
        at org.jboss.web.deployers.AbstractWarDeployer.deploy(AbstractWarDeployer.java:400) [:6.0.0.Final]
        ... 47 more

Almost all the Internet queries have problems. There are files in the meta-inf folder of the packaged jar or war.JBoss is trying to process these files or doesn’t want to process them there.

However, I found that my meta-inf folder was empty and there was no * RSA,*.DSA,*.SF and other documents are hard to understand
I have also tried to repackage and replace the Tomcat version, but this problem has not been solved.

Finally, I thought that the project is divided into modules. Are there these files in the jar package generated by the referenced submodule? Finally, I checked one by one and finally found the problem:
there are these * RSA,*. DSA,*. SF files

remove these files from the jar package:

zip -d <jar file name>.jar META-INF/*.RSA META-INF/*.DSA META-INF/*.SF

But this is a temporary solution but not a permanent solution. The problem will still occur in the next packaging. Finally, go to the pom.xml file to exclude META-INF/*.SF and other files

<plugin>
	<groupId>org.apache.maven.plugins</groupId>
	<artifactId>maven-shade-plugin</artifactId>
	<version>3.1.1</version>
	<executions>
		<execution>
			<phase>package</phase>
			<goals>
				<goal>shade</goal>
			</goals>
			<configuration>
				<filters>
					<filter>
						<artifact>*:*</artifact>
						<excludes>
							<!-- Exclude the following files to prevent verification errors when the program is started  -->
							<exclude>META-INF/*.SF</exclude>
							<exclude>META-INF/*.DSA</exclude>
							<exclude>META-INF/*.RSA</exclude>
						</excludes>
					</filter>
				</filters>
			</configuration>
		</execution>
	</executions>
</plugin>

Solution to error [error] LD returned 1 exit status in C language

This error is sometimes reported when writing C/C + + experiments:

[Error] ld returned 1 exit status

This error is sometimes reported, that is, when running, it will jump to the warning place to report an error, but the warning will not report an error originally.

There are several reasons:

1. Other functions are defined in the main function

2. When there are many codes, the function name of a library function is wrong, such as scanf, printf and main

3. A custom function has only a function name and no function body, but is called

4. The function name of the custom function is inconsistent with the parameters in the function body below, resulting in the non existence of the called function

5. The last running program has not been closed

Hadoop Startup Error: sbin/start-dfs.sh [How to Solve]

HADOOP Command sbin/start-dfs.sh Start Error
Error: Cannot find configuration directory: /etc/hadoop
JAVA_HME is not set and could not be found
Solution:
Configure hadoop-env.sh file in hadoop-2.7.1/etc/hadoop. write your own jdk and hadoop paths.
export JAVA_HOME=/usr/jdk1.8.0_221
export HADOOP_CONF_DIR=/usr/hadoop-2.7.1/etc/hadoop/

error RC2247 : SYMBOL name too long [How to Solve]

An error was reported in compiling usbview today…

error RC2247 : SYMBOL name too long

Therefore, you only need to add it in front of the original usbview.rc


#define APSTUDIO_HIDDEN_SYMBOLS
#include "windows.h"
#include "prsht.h"
#include "wtypes.h"
#undef APSTUDIO_HIDDEN_SYMBOLS

Then it’s OK
later, use the resource editor provided by vs to change the location and update the resource content again

In this case, the modified full usview.rc content is provided:

#define APSTUDIO_HIDDEN_SYMBOLS
#include "windows.h"
#include "prsht.h"
#include "wtypes.h"
#undef APSTUDIO_HIDDEN_SYMBOLS


#include <windows.h>
#include <commctrl.h>
#include "resource.h"



//#if WINNT
//#include <ntverp.h>
//#else
//#include <version.h>
//#endif


//
//
// VERSION
//
#define VER_FILEDESCRIPTION_STR     "Microsoft\256 Windows(TM) USB Device Viewer"
#define VER_INTERNALNAME_STR        "USBVIEW"
#define VER_ORIGINALFILENAME_STR    "USBVIEW.EXE"
#define VER_LEGALCOPYRIGHT_STR      "Copyright \251 Microsoft Corporation 1996-2008.  All Rights Reserved."

#define VER_FILETYPE     VFT_APP
#define VER_FILESUBTYPE  VFT2_UNKNOWN

//#include <common.ver>


//
//
// ICON
//
IDI_ICON                ICON    DISCARDABLE     "USB.ICO"
IDI_BADICON				ICON	DISCARDABLE		"BANG.ICO"
IDI_COMPUTER			ICON	DISCARDABLE		"MONITOR.ICO"
IDI_HUB					ICON	DISCARDABLE		"HUB.ICO"
IDI_NODEVICE			ICON	DISCARDABLE		"PORT.ICO"

//
//
// Cursor
//
IDC_SPLIT               CURSOR  DISCARDABLE     "SPLIT.CUR"

/
//
// Dialog
//

IDD_MAINDIALOG DIALOGEX 0, 0, 640, 350
STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU | 
    WS_THICKFRAME
CAPTION "USB View"
MENU IDR_MENU
FONT 8, "MS Shell Dlg"
BEGIN
    CONTROL         "Tree1",IDC_TREE,"SysTreeView32",TVS_HASBUTTONS | 
                    TVS_HASLINES | TVS_LINESATROOT | WS_BORDER | WS_TABSTOP,
                    0,0,400,341,WS_EX_CLIENTEDGE
    EDITTEXT        IDC_EDIT,400,0,240,341,ES_MULTILINE | ES_READONLY | 
                    WS_VSCROLL | WS_HSCROLL
    CONTROL         "Devices Connected: 0",IDC_STATUS,"msctls_statusbar32",
                    SBARS_SIZEGRIP,
                    0,342,640,8
END


IDD_ABOUT DIALOG DISCARDABLE  0, 0, 212, 82
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "About USBView"
FONT 8, "MS Shell Dlg"
BEGIN
    DEFPUSHBUTTON   "OK",IDOK,80,62,50,14
    LTEXT           "USB Device Viewer",IDC_STATIC,54,15,64,8
    LTEXT           "Copyright (c) 1996-2008 Microsoft Corporation",
                    IDC_STATIC,54,30,145,8
#ifndef WINNT
    LTEXT           "Version",IDC_STATIC,55,45,24,8
    LTEXT           VER_PRODUCTVERSION_STR,IDC_STATIC,87,45,33,8
#endif
    ICON            IDI_ICON,IDC_STATIC,15,15,21,20
END


/
//
// Menu
//

IDR_MENU MENU DISCARDABLE 
BEGIN
    POPUP "&File"
    BEGIN
        MENUITEM "&Refresh\tF5",                ID_REFRESH
        MENUITEM SEPARATOR
        MENUITEM "E&xit",                       ID_EXIT
    END
    POPUP "&Options"
    BEGIN
        MENUITEM "&Auto Refresh",               ID_AUTO_REFRESH
        MENUITEM "&Config Descriptors",         ID_CONFIG_DESCRIPTORS
    END
    POPUP "&Help"
    BEGIN
        MENUITEM "&About",                      ID_ABOUT
    END
END

//
//
// Accelerator
//

IDACCEL ACCELERATORS DISCARDABLE 
BEGIN
    VK_F5,          ID_REFRESH,             VIRTKEY,NOINVERT
END

Content of resource.H:

/*++
Copyright (c) 1998 Microsoft Corporation, All Rights Reserved.
--*/

#define IDD_MAINDIALOG                  101
#define IDR_MENU                        102
#define IDD_ABOUT                       103
#define IDI_ICON                        104
#define IDC_SPLIT                       105
#define IDACCEL                         106

// added ScottT
#define IDI_BADICON                     107
#define IDI_COMPUTER                    108
#define IDI_HUB                         109
#define IDI_NODEVICE                    110

#define IDC_TREE                        1000
#define IDC_EDIT                        1001
#define IDC_STATUS                      1002
#define ID_EXIT                         40001
#define ID_REFRESH                      40002
#define ID_AUTO_REFRESH                 40003
#define ID_CONFIG_DESCRIPTORS           40004
#define ID_ABOUT                        40005
#define IDC_STATIC                      0xFFFFFFFF


#define VER_PRODUCTVERSION_STR			"ubzh.com"

/usr/lib/deepin-wine/wine: error while loading shared libraries: libwine.so.1

After deepin wine is installed, the following errors occur when installing other applications:

 / usr/lib/deepin-wine/wine: error while loading shared libraries: libwine.so.1: cannot open shared object file: No such file or directory

There was a problem with the link and you need to re link:

ln -sf /usr/lib/i386-linux-gnu/deepin-wine/libwine.so.1.0 /usr/lib/i386-linux-gnu/deepin-wine/libwine.so.1

https://github.com/wszqkzqk/deepin-wine-ubuntu

error MSB8011: Failed to register output [How to Solve]

error MSB8011: Failed to register output. Please try enabling Per-user Redirection or register the component from a command prompt with elevated permissions.

Cause of formation: in versions above win7, only administrator privileges can run regsvr32.exe program, that is, only administrator privileges can register controls or DLLs.

Solution:

1. When running vs, right-click to run with administrator privileges. Do not open vs directly.

2. Engineering – > Propertier–> Linker–> General–> Register Output–> NO。