Mobile edge computation (MEC) is a potential technology to reduce the energy consumption and task execution delay for tackling computation-intensive tasks on mobile device (MD). The resource allocation of MEC is an optimization problem, however, the existing large amount of computation may hinder its practical application. In this work, we propose a multiuser MEC framework based on unsupervised deep learning (DL) to reduce energy consumption and computation by offloading tasks to edge servers. The binary offloading decision and resource allocation are jointly optimized to minimize energy consumption of MDs under latency constraint and transmit power constraint. This joint optimization problem is a mixed integer nonconvex problem which result in the gradient vanishing problem in backpropagation. To address this, we propose a novel binary computation offloading scheme (BCOS), in which a deep neural network (DNN) with an auxiliary network is designed. By using the auxiliary network as a teacher network, the student network can obtain the lossless gradient information in joint training phase. As a result, the sub-optimal solution of the optimization problem can be acquired by the learning-based BCOS. Simulation results demonstrate that the BCOS is effective to solve the binary offloading problem by the trained network with low complexity.