Author Archives: Robins

[Solved] Error (suppressible): (vsim-12110) All optimizations are disabled because the -novopt option is in effect…

Questasim Error(vsim-12110)

Questasim simulation optimization acceleration problem (object no signal, could not see waveform)

Makefile script:

Compilation error:

Solution:

Remove -novopt, which is no longer used in modelsim after version 10.7, so as long as you do not use -novopt, no error will be reported. So how can we see the signal and see the waveform while using optimization?

Here I modify modelsim.ini

Find modelsim.ini file address

Modify VoptFlow = 1

In addition, you can replace -novopt with -voptargs= “+acc”

[Solved] AttributeError: ‘PngImageFile‘ object has no attribute ‘imshow‘

How to solve error attributeerror:’pngimagefile’object has no attribute’imshow’ Successfully.


Error:

AttributeError: ‘PngImageFile’ object has no attribute ‘imshow’

Reasons:

Attribute error: the “pngimagefile” object does not have the attribute “imshow”

Solution:

Pngimagefile does not have imshow method, but has show method, so the following changes are required!

Modify
img.imshow()
to
img.show()

[Solved] ERROR Error: No module factory availabl at Object.PROJECT_CONFIG_JSON_NOT_VALID_OR_NOT_EXIST ‘Error

1. Use wechat one-click packaging tool report the following error:

ERROR Error: No module factory available for dependency type: CssDependency

‘error: please check project.config Whether JSON exists and is valid (code 19) error: please check

2. Solutions

Hbuilder x development tools cannot be placed on the same disk as project files. The above errors will occur. If the development tools are placed on disk D and the project files are placed on disk e or disk F, the above errors will not be reported

How to Solve K8S Error getting node

During the installation or operation of k8s cluster, you may encounter problems of "error getting node", such as:

"Error getting node" err="node \"master\" not found"
dial tcp 10.8.126.46:6443: connect: connection refused"
"Error getting node" err="node \"master\" not found"
"Error getting node" err="node \"master\" not found"

The way to troubleshoot such problems is to execute the following commands to check the specific error causes:

journalctl -xeu kubelet

Find the initial error and deal with it according to different errors
according to the problems I have encountered, there are mainly the following possibilities:

  1. No swap memory disabled
  2. There is a problem with hostname setting or hosts setting (other bloggers listed reasons)
  3. The container and k8s version is not compatible (other bloggers listed reasons)

[Solved] ERROR: lib/bridge_generated.dart:837:9: Error: The parameter ‘ptr‘ of the method ‘FlutterRustB

[error reporting]

Launching lib/main.dart on Linux in debug mode...
Finished dev [unoptimized + debuginfo] target(s) in 0.04s
ERROR: lib/bridge_generated.dart:837:9: Error: The parameter 'ptr' of the method 'FlutterRustBridgeExampleWire.store_dart_post_cobject' has type 'int', which does not match the corresponding type, 'Pointer<NativeFunction<Bool Function(Int64, Pointer)>>', in the overridden method, 'FlutterRustBridgeWireBase.store_dart_post_cobject'.
ERROR: - 'Pointer' is from 'dart:ffi'.
ERROR: - 'NativeFunction' is from 'dart:ffi'.
ERROR: - 'Bool' is from 'dart:ffi'.
ERROR: - 'Int64' is from 'dart:ffi'.
ERROR: - 'Void' is from 'dart:ffi'.
ERROR: Change to a supertype of 'Pointer<NativeFunction<Bool Function(Int64, Pointer)>>', or, for a covariant parameter, a subtype.
ERROR: int ptr,
ERROR: ^
ERROR: ../../frb_dart/lib/src/basic.dart:153:8: Context: This is the overridden method ('store_dart_post_cobject').
ERROR: void store_dart_post_cobject(
ERROR: ^
Building Linux application...
Exception: Build process failed

[Solution]

$ export REPO_DIR=$PWD
$ cd /

$ flutter_rust_bridge_codegen \
    --rust-input $REPO_DIR/rust/src/api.rs \
    --dart-output $REPO_DIR/lib/bridge_generated.dart \
    --c-output $REPO_DIR/ios/Classes/bridge_generated.h
[2021-10-22T14:39:33Z INFO  flutter_rust_bridge_codegen] Picked config: Opts { rust_input_path: "/home/consulting/Documents/native_add/rust/src/api.rs", dart_output_path: "/home/consulting/Documents/native_add/lib/bridge_generated.dart", c_output_path: "/home/consulting/Documents/native_add/ios/Classes/bridge_generated.h", rust_crate_dir: "/home/consulting/Documents/native_add/rust", rust_output_path: "/home/consulting/Documents/native_add/rust/src/bridge_generated.rs", class_name: "NativeAdd", dart_format_line_length: 80, skip_add_mod_to_lib: false }
[2021-10-22T14:39:33Z INFO  flutter_rust_bridge_codegen] Phase: Parse source code to AST
[2021-10-22T14:39:33Z INFO  flutter_rust_bridge_codegen] Phase: Parse AST to IR
[2021-10-22T14:39:33Z INFO  flutter_rust_bridge_codegen] Phase: Transform IR
[2021-10-22T14:39:33Z INFO  flutter_rust_bridge_codegen] Phase: Generate Rust code
[2021-10-22T14:39:33Z INFO  flutter_rust_bridge_codegen] Phase: Generate Dart code
[2021-10-22T14:39:33Z INFO  flutter_rust_bridge_codegen] Phase: Other things
[2021-10-22T14:39:34Z INFO  flutter_rust_bridge_codegen] Success! Now go and use it :)

$ cd $REPO_DIR

[Solved] Error:The above error occurred in one of your React components & A component suspended while respondi

lazyLoad of routing components, lazy loading problem, when using the lazy function of react in conjunction with the import() function to dynamically load routing components.

import React, { Component, lazy } from 'react'
·······

const Login = lazy(()=>import('XXXX'))

The following errors will be reported:

Error analysis: suspended=> When the network speed is slow and the specified routing component page is not loaded, you need to use the fallback in suspend to load the contents of the fallback before the specified page appears.

Solution:

import React, { Component, lazy,Suspense } from 'react'
·····

const Home = lazy(()=> import('./Home'))
const About = lazy(()=> import('./About'))

·······
<Suspense fallback={<h2>Loading..</h2>}>
  <Routes>
     <Route path="/about" element={<About/>}/>
     <Route path="/home" element={<Home/>}/>
   </Routes>
</Suspense>

[Solved] Mac git clone error:xcrun:error:invalid active developer path(/Library/Developer/CommandLineTools)

Background

After upgrading the MAC system, using git clone and other related commands on the terminal fails with an error

xcrun:error:invalid active developer path(/Library/Developer/CommandLineTools),missing xcrun at:/Library/Developer/CommandLineTools/usr/bin/xcrun

Troubleshooting

1. Check whether git has been installed

# command
which git

# outcome
/usr/local/bin/git

Description git has been installed

2. View git help information

git --help

Error reporting is the same as above:

xcrun:error:invalid active developer path(/Library/Developer/CommandLineTools),missing xcrun at:/Library/Developer/CommandLineTools/usr/bin/xcrun

to sum up, GIT has been installed, but the GIT command cannot be used normally. It may be that the GIT installation package is damaged, so reinstall git

3. Reinstall Git

brew install git

The following error messages appear during installation:

Error: The following formula:
  git
cannot be installed as a binary package and must be built from source.
Install the Command Line Tools:
  xcode-select --install

Error: Git must be installed and in your PATH!
Error: The following formula:
  git
cannot be installed as a binary package and must be built from source.
Install the Command Line Tools:
  xcode-select --install

according to the prompt, you need to reinstall xcode-select

Solution: install xcode-select

To sum up, we need to reinstall xcode-select and execute the following commands on the terminal

 xcode-select --install

After installation, perform the following:

git --help

The correct output of information indicates that git has returned to normal and can be used

 

[Solved] Yolov5 Deep Learning Error: RuntimeError: DataLoader worker (pid(s) 2516, 1768) exited unexpectedly

Project scenario:

There is a problem when using yolov5 for deep learning. I use GPU for learning.


Problem description

An error is reported at the beginning of learning, RuntimeError: DataLoader worker (pid(s) 2516, 1768) exited unexpectedly.


Cause analysis:

Because I use GPU to learn, Anaconda’s virtual memory is also allocated enough, so the problem should be the setting of the number of CPU threads. Before that, I tried to adjust the batch size, but it didn’t work.


Solution:

In train There is a parameter of --workers in the file of py.

There is a parameter named --workers in the train.py file. Set it to 0.

the following is my setting, you can refer to it~~~

def parse_opt(known=False):
    parser = argparse.ArgumentParser()
    parser.add_argument('--weights', type=str, default=ROOT/'yolov5x.pt', help='initial weights path') #初始权重值
    parser.add_argument('--cfg', type=str, default='yolov5_Scan_FDDI/PLC_model.yaml', help='model.yaml path') #训练模型文件
    parser.add_argument('--data', type=str, default=ROOT/'yolov5_Scan_FDDI/PLC_parameter.yaml', help='dataset.yaml path') #数据集参数文件
    parser.add_argument('--hyp', type=str, default=ROOT/'data/hyps/hyp.scratch-low.yaml', help='hyperparameters path') #超参数设置
    parser.add_argument('--epochs', type=int, default=100) #训练轮数
    parser.add_argument('--batch-size', type=int, default=4, help='total batch size for all GPUs, -1 for autobatch') #batch size
    parser.add_argument('--imgsz', '--img', '--img-size', type=int, default=320, help='train, val image size (pixels)') #图片大小
    parser.add_argument('--rect', action='store_true', help='rectangular training')
    parser.add_argument('--resume', nargs='?', const=True, default=False, help='resume most recent training') #断续训练
    parser.add_argument('--nosave', action='store_true', help='only save final checkpoint')
    parser.add_argument('--noval', action='store_true', help='only validate final epoch')
    parser.add_argument('--noautoanchor', action='store_true', help='disable AutoAnchor')
    parser.add_argument('--noplots', action='store_true', help='save no plot files')
    parser.add_argument('--evolve', type=int, nargs='?', const=300, help='evolve hyperparameters for x generations')
    parser.add_argument('--bucket', type=str, default='', help='gsutil bucket')
    parser.add_argument('--cache', type=str, nargs='?', const='ram', help='--cache images in "ram" (default) or "disk"')
    parser.add_argument('--image-weights', action='store_true', help='use weighted image selection for training')
    parser.add_argument('--device', default='0', help='cuda device, i.e. 0 or 0,1,2,3 or cpu') #GPU
    parser.add_argument('--multi-scale', action='store_true', help='vary img-size +/- 50%%')
    parser.add_argument('--single-cls', action='store_true', help='train multi-class data as single-class')
    parser.add_argument('--optimizer', type=str, choices=['SGD', 'Adam', 'AdamW'], default='SGD', help='optimizer')
    parser.add_argument('--sync-bn', action='store_true', help='use SyncBatchNorm, only available in DDP mode')
    parser.add_argument('--workers', type=int, default=0, help='max dataloader workers (per RANK in DDP mode)') #CPU线程数设置
    parser.add_argument('--project', default=ROOT/'runs/train', help='save to project/name')
    parser.add_argument('--name', default='exp', help='save to project/name')
    parser.add_argument('--exist-ok', action='store_true', help='existing project/name ok, do not increment')
    parser.add_argument('--quad', action='store_true', help='quad dataloader')
    parser.add_argument('--cos-lr', action='store_true', help='cosine LR scheduler')
    parser.add_argument('--label-smoothing', type=float, default=0.0, help='Label smoothing epsilon')
    parser.add_argument('--patience', type=int, default=100, help='EarlyStopping patience (epochs without improvement)')
    parser.add_argument('--freeze', nargs='+', type=int, default=[0], help='Freeze layers: backbone=10, first3=0 1 2')
    parser.add_argument('--save-period', type=int, default=-1, help='Save checkpoint every x epochs (disabled if < 1)')
    parser.add_argument('--seed', type=int, default=0, help='Global training seed')
    parser.add_argument('--local_rank', type=int, default=-1, help='Automatic DDP Multi-GPU argument, do not modify')

    # Weights & Biases arguments
    parser.add_argument('--entity', default=None, help='W&B: Entity')
    parser.add_argument('--upload_dataset', nargs='?', const=True, default=False, help='W&B: Upload data, "val" option')
    parser.add_argument('--bbox_interval', type=int, default=-1, help='W&B: Set bounding-box image logging interval')
    parser.add_argument('--artifact_alias', type=str, default='latest', help='W&B: Version of dataset artifact to use')

    opt = parser.parse_known_args()[0] if known else parser.parse_args()
    return opt

[Solved] Centos7 xmapp Install Error: error while loading shared libraries: libc.so.6

1. Version information:

CentOS version: CentOS release 6.9 (final)

xmapp version: xampp-linux-x64-5.6.40-1-installer.run

2. Error message:

[root@localhost ~]# /opt/lampp/lampp
egrep: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
egrep: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
/bin/bash: error while loading shared libraries: libdl.so.2: cannot open shared object file: No such file or directory
egrep: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
/opt/lampp/bin/gettext: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory

id: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
/opt/lampp/share/xampp/xampplib: line 11: test: -ne: unary operator expected
/opt/lampp/bin/gettext: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
XAMPP: egrep: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
netstat: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
egrep: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
netstat: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
/opt/lampp/bin/gettext: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
/opt/lampp/bin/httpd: error while loading shared libraries: librt.so.1: cannot open shared object file: No such file or directory
/opt/lampp/bin/gettext: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
XAMPP: hostname: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
egrep: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
netstat: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
/opt/lampp/bin/gettext: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
/opt/lampp/bin/gettext: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
XAMPP: /bin/sh: error while loading shared libraries: libdl.so.2: cannot open shared object file: No such file or directory
egrep: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
netstat: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
/opt/lampp/bin/gettext: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
/opt/lampp/bin/gettext: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory

3. Solution:

1. Open /opt/lampp/lampp

vim /opt/lampp/lampp

2. Edit
Modify this line

export LD_ASSUME_KERNEL=2.2.5

to

export LD_ASSUME_KERNEL=2.8.0

Find a word in the file [under the command line/keyword, enter to find, enter n to find the next]

[Solved] Nacos Serve Local Startup Error: Error starting Tomcat context. Exception: org.springframework.beans.factory.BeanCre

Environmental Science:

Nacos-server-2.0.4

Windows.8.1

nacos-server-2.0.4\nacos\bin\startup.cmd execute error

Error message: Error starting Tomcat context. Exception: org.springframework.beans.factory.BeanCreationException

Reason for error: Nacos defaults to the cluster startup mode

Modify as shown in the figure to start a single machine

set MODE="standalone"

Start successful

Other solutions:

Start by command

startup.cmd -m standalone

[Solved] Hadoop Error: ERROR: Cannot set priority of namenode process

Phenomenon:

solve:

1. Look at Hadoop logs:

Check the namenode log: tail -n 200 hadoop-xinjie-namenode-VM-0-9-centos.log (location of file directory: Hadoop installation location logs file)

2. It is found that the port is occupied

3. Command to check the port occupancy: netstat -anp|grep 9866

4. Kill process: kill -9 9866

5. Restart the cluster after killing all the occupied ports. The problem is solved