To improve the output error compensation accuracy of fiber optic gyroscope(FOG)in variable temperature environments,the piecewise nonlinear particle swarm optimization(PN-PSO)is used to optimize the hyperparameters of the long and short-term memory neural network(LSTM),and the PN-PSO-LSTM model for compensating the output error of FOG is established.In order to effectively reduce the computation and storage overhead and facilitate deployment in resource-constrained hardware environments,a set of model compression schemes suitable for FOG application scenarios are proposed,including knowledge distillation,pruning,linearization of activation function,quantization of fixed points,etc.Finally,the deployment is completed based on a chip from Xilinx.Comparison experimental results show that compared with the traditional BP model and traditional PSO-LSTM model,the gyro zero-bias output mean square error is reduced by 74.4%and 53.5%respectively after using the proposed model compensation,and the gyro zero-bias output mean square error is still lower than the traditional full-precision model after model compression while the size is reduced by 94.1%,and the model reasoning speed is increased by 98.47%compared with that of PC model after the implementation in FPGA.